Usersettings - Dependent dropdown

Hmmm. I simply can't wrap my head around, how to do this.

In usersettings i have 2 entries

First - Afdeling - And under this i Have a Enum that has a Valid_IF that looks like this -Login[Afdeling]- I have the table Login and it creates a Dropdown with values.

Next - The second Entry is Navn - And here is my problem. I have several restaurants with different people. I have created each Restaurant as a column. The names of the restaurants equal to the list in Afdeling. And in Navn i would like to only have names from that restaurant, chosen in Afdeling.

Ex. If i choose Administration, it should only show the list of names in from the column Administration as a dropdown, and if i choose Norrlyst, it should make a liste of names from the column Norrlyst.

Can anyone help me here or guide me to a solution?

Skรฆrmbillede 2023-08-25 kl. 21.17.13.png

Solved Solved
0 2 277
1 ACCEPTED SOLUTION


@LHAdmin wrote:

Hmmm. I simply can't wrap my head around, how to do this.

Can anyone help me here or guide me to a solution?


The reason you are struggling is that the data table with the list of names is in non-normal form - i.e. you have to add columns to expand the Restaurant choice list. 

While you can use it that way, it is not recommended since it requires an app updates everytime new Restaurants need to be added.  Also, any expressions that need to return the proper list of people, will need to explicitly included sub-expression for EACH location and updated as well when new locations are added.

Instead, you want to split this single table.  List your "Afdeling" items in one table - yes even if that is the only column.   The people would be listed in a "Persons" table defined like this:

ID Location Name
a1 Administration Bjarke
a2 Administration Emil
a3  Administration Christian
... ... ...
b4 Norrlyst  Jonas
b5 Norrlyst Simon
... ... ...
b15 Theo Jacob
b16 Theo Erica
... ... ...
d45 Gemini Tore
d46 Gemini Mail
... ... ...

Then in your Form when you have chosen an "Afdeling" item you can use a general expression like this:

SELECT(Persons[Name], [Location] = [_THISROW].[Afdeling])

 The big advantage here is that you can now add additional Locations with their list of people in the Persons table and they will automatically show up in the app with no need for additional app changes.

I hope this helps!

View solution in original post

2 REPLIES 2


@LHAdmin wrote:

Hmmm. I simply can't wrap my head around, how to do this.

Can anyone help me here or guide me to a solution?


The reason you are struggling is that the data table with the list of names is in non-normal form - i.e. you have to add columns to expand the Restaurant choice list. 

While you can use it that way, it is not recommended since it requires an app updates everytime new Restaurants need to be added.  Also, any expressions that need to return the proper list of people, will need to explicitly included sub-expression for EACH location and updated as well when new locations are added.

Instead, you want to split this single table.  List your "Afdeling" items in one table - yes even if that is the only column.   The people would be listed in a "Persons" table defined like this:

ID Location Name
a1 Administration Bjarke
a2 Administration Emil
a3  Administration Christian
... ... ...
b4 Norrlyst  Jonas
b5 Norrlyst Simon
... ... ...
b15 Theo Jacob
b16 Theo Erica
... ... ...
d45 Gemini Tore
d46 Gemini Mail
... ... ...

Then in your Form when you have chosen an "Afdeling" item you can use a general expression like this:

SELECT(Persons[Name], [Location] = [_THISROW].[Afdeling])

 The big advantage here is that you can now add additional Locations with their list of people in the Persons table and they will automatically show up in the app with no need for additional app changes.

I hope this helps!

Thank you SO Much!

That did the job

Top Labels in this Space