Narrowing down option in the Dependent Dropdown Appsheet example

I have a sample app that closely resembles what I’m trying to achieve:
https://www.appsheet.com/samples/How-to-create-a-dropdown-menu-with-values-that-depend-on-earlier-ch...

Despite “looking under the hood” I cant get my app to do the same as their must be some way things are ordered on the table to get it to work. I cant view the table directly to see how they did it. Let me walk you through my issue.

The example app asks the person to choose “Continent” and once the user does that it gives them a couple of countries on that continent to choose from.

My app will ask for a route and then give the user several “facilities” to choose from.

Looking under the hood we see that the Continent column in the Comments table has the type “enum” and with data validity Documents[Continent]. Click the link below to see:

I can get mine to sort by route as well. Great! The next part I cant figure out how to emulate, and that is where it changes the list of options for country to match previous choice of continent. In mine, after selecting a route, only the relevant facilities should be shown.

If you click on the Country collumn in the sample app, the data type is enum, and the validity is handled the same as Continent - “Documents[Country]”

How does that validity only select the countries relevant to their continent? Why wouldn’t it just select all countries in the column?

If someone can help me out here, I could finish my app. Thank you very much in advance.

Edit: Apparently someone marked this as spam/advertisement???

0 9 1,056
9 REPLIES 9

Steve
Platinum 4
Platinum 4

Have you looked here?

Hi @P3_Petroleum. From the docs @Steve refered to: “Likewise, the ‘Country’ column also specifies a similar Valid_If constraint: Regions[Country] . However, because it follows the ‘Lead Region’ column and because both specify columns from the same lookup table ‘Regions’, AppSheet recognizes the intent and implements a dependent dropdown.”

I hadn’t seen that link. My sheet is made a bit differently and it doesnt come directly after the lead expression and has several other columns in between. Perhaps that’s what messing me up. Ill try it again, and if not, I will implement the advanced expression shown at the bottom of that help page.

You can use a slice to reorder the columns in the form while allowing the spreadsheet columns to be in the order needed for dependent drop-downs.

@Steve Thanks for the tip about slices, but I went ahead and just reordered my columns for now - its working; however, the list is out of order and routes are shown by order they are mentioned in the collumn. This order could change so I need a way to sort alphabetically. I went ahead and looked up how to do that but I’m running into this issue for the past several hours.

I determined ORDERBY() is the function I’m looking for.

I’ve got one table that works like a form and is pulling “Route” and “Facility” from another table.

I’ve tried many combinations but this one seems the most correct so I’ll use it here for the example:
ORDERBY(Facilities[Route], [Route])

I chose this based off the example appsheets gave:
ORDERBY(Products[Product ID], [Product Name])

The error I get is that Route isn’t a column on the table that creates the form. It is on the “Facilities” table with the facility name. To clarify this I tried to distinguish the table by adding the table name before route.

ORDERBY(Facilities[Route], Facilities[Route])

That seems wrong though… and sure enough there is an error.

Once I figure this out I’m hoping to try sorting by distance to facility using this example I’ve found. I think the field personnel would appreciate that quality of life improvement to avoid sorting through a drop down.

https://www.appsheet.com/samples/Initialize-a-form-with-values-from-nearest-location?appGuidString=5...

When I use this it breaks the detection that its a dependent drop down, but it is now indeed alphabetized.

@Steve I did some more testing.

If I sort the dropdown for the results question, OR the results for the following facility question it will break the dependent dropdown detection, as well as both together.

I kinda suspected that: the magic of the dependent drop-down has specific, somewhat-limiting requirements. You’ll have to use more complicated formulas, then.

Top Labels in this Space