Dependent drop down - issue w/sorting

I have duplicated the dependent drop down behavior in this app (see the dependency between 'Lead Region' and 'Lead Country'). https://www.appsheet.com/templates/An-app-to-add-and-update-sales-leads?appGuidString=2f43eb0a-1dbf-...

Except my app is not sorting the data the way the demo app is, and I cannot figure out why. If you look at the tables in the test app, the columns are not in any order, however, the presented drop downs are in alphabetical order. Additionally, the test app is not using any ORDERBY() in the Valid_IF field.

My app is not sorting. I have tried both a SORT() and an ORBERBY() in the valid_if field, but everytime I do that, the linkage between the dependent fields break.

This post seems to indicate that the sort is not possible with a dependency. However the demo app above shows that indeed there is some internal feature in AppSheet that can do this. 

Anyone have any ideas how to exactly duplicate the Demo App's sorted dependent drop downs?

 

0 4 465
4 REPLIES 4

The actual data in that sample app is already sorted appropriately in the table. That's why it appears as sorted without having to add anything extra to their valid_ifs.

Appsheet's automatic dependent dropdown feature is very fickle. It stops working under even the most minor alteration. Like wrapping it with SORT(). If you need to do that, you'll need to explicitly set up the depdendent dropdown. Your first column can still be simple: SORT( table[col1] ). But your second column will need to be an actual SELECT expression: SORT( SELECT( table[col2] , [col1] = [_THISROW].[col1] ) )

Also, ORDERBY only works for key values.

 

I made a copy of the app and then viewed the underlying google sheet, and the data is definitely not sorted:

Screenshot 2023-03-02 200521.png

It only appears that way when you click Look Under the Hood --> Preview Data. Any idea why the Preview would show sorted? That might be the answer to this question.

I'll try to set up the more explicit dependent drop down, it may be over my head. 

 

 

You're looking at the wrong table.

Hi @Marc_Dillon , Superb!, I have been researching this for hours, now your Sort formula works brilliantly. Thank you so much.

Top Labels in this Space