I’m working on a tourism app and I have the following tables:
Destination (Parent Table)
Restaurant (Child Table of Destination)
Restaurant Services (Child Table of Restaurant)
Logic behind it: A Travel Agent will book a service (buffet, for example) at a restaurant in a specific destination.
The issue:
I’m trying to create several depending dropdown list
Restaurants, when a destination is selected (This one works).
Services, when a restaurant is selected (This one is the problem since it depends on the previous one).
For restaurant dropdown (this works fine)
IN( [_THIS], SELECT(Restaurant[restName], [_THISROW].[destinoID] = [restDestino]))
For restaurant services dropdown
IN( [_THIS], SELECT(RestaServ[restServServicio], [_THIS].[restID] = [restID]))
However, when I open the form the list of restaurant services is already populated with all the options even though the restaurant hasn’t been selected yet.
I’m guessing that this might be because of [_THIS].[restID] is blank when the form opens?
Automatic dependent dropdowns only work for columns with Valid If expressions that use only a table-column reference. You appear to be using more sophisticated expressions, which will override the automatic dependent dropdown feature.
I have applied this change and the result is the opposite that it was happening hehe.
Now when the form loads the restaurant services appear in blank (which is great!) but even if a Restaurant is selected the previous dropdown the list of services won’t upload.
In a Valid If expression, the IN() wrapper of IN([_THIS], ...) is unneeded (but also okay to use) if ... is a list. Both SELECT() (which you used) and FILTER() (which I use here) produce lists.
I’ve suggested FILTER() because it always produces a list of Ref values. Many people get confused with how to gather Ref values using SELECT(), so FILTER() removes the chance to make a mistake.