dependent dropdown from enum list only working for second dropdown

I have a form where I would like to select multiple cities, from my client's table and have the associated phone number, from the same client's table, automatically populate in the phone number field. I have a valid_if as Clients[City] and it works to show all the cities. My second form field is phone numbers and is desired to only show the client's phone number where it matches the city or cities selected in the previous field. This has a vaild_if as Clients{phone number].

This is where the problem starts. The phone numbers will all show up, regardless of what city I choose, when the cities type field is set to enum list and phone numbers set to enum list causing a mismatch of information.

The phone numbers show up in the dropdown for phone numbers as desired with the appropriate city selected, ONLY when the city field type is set as text and the phone number field is set as enum list. This allows me to select all the phone numbers for one city, which works but I am hoping for more.

 I am wanting to select more than one city and have the phone numbers, associated with the cities selected to show up in the phone number dropdown. Better yet, would be nice to select more than one city and have the phone number automatically selected, like an initial value. This would just make it to where I select the desired city or cities from the city list and all associated phone numbers are then selected for me.

Thanks in advance for the help!

 

0 3 296
3 REPLIES 3

When you move to an enumlist, you have to go with a DIY dependent dropdown setup, instead of relying on Appsheet's implicit functionality. You'd need to utilize IN() in your valid_if to check against the enumlist. Something like:

SELECT(
  Clients[phone] ,
  IN( [city] , [_THISROW].[cities] )
)

Would both dropdowns then be type enum list with the select() functions? If so, the first enum list would be the locations field that I can select the cities from so this would pull the city or cities from the clients table and the second drop down will then have all the phone numbers that match the selected cities from the clients table?

The first one doesn't need to be SELECT, it can stay like it is, because it's an unconditional list.

https://help.appsheet.com/en/articles/4575739-list-from-table-column-reference

https://help.appsheet.com/en/articles/2357314-select

 

Top Labels in this Space