Unsorted dropdow list using data from another table

I have a form whose data inputs a tab called "Database". In this form, among other things, I collect the country of a given customer and this field (called "Country") is a Ref type coming from a separate tab called "Country to Country Rating mapping". This, in turn, has a list of all countries and their associated Moody's rating.

The issue is that my form shows this dropdown list of the Country field in a (apparently) random order. I've tried to use ORDERBY in the valid_if piece (as suggested in this example: https://www.appsheet.com/templates/How-to-ordersort-the-values-in-dropdowns?appGuidString=0d0fee2c-b...), but I'm clearly doing something wrong.

Here is my valid_if statement: ORDERBY('Country to Country Rating mapping'[Country], [Country])

It says "ORDERBY has invalid inputs.

Note: the key column in my tab "Country to Country Rating mapping" is indeed "Country", hence why I'm passing it as the first parameter.

I've tried SORT too and it doesn't work either. Any clue on what is wrong?

Solved Solved
0 5 151
1 ACCEPTED SOLUTION

ORDERBY(SELECT(Country to Country Rating mapping[Country], true), [Country])

View solution in original post

5 REPLIES 5

ORDERBY(SELECT(Country to Country Rating mapping[Country], true), [Country])

That was super fast and it works! Do you have a clue on what was wrong in my approach?

Thanks a lot for the solution!

I think that your single quote was breaking the code

Thanks! It does work if I remove the quote. I can never tell when to use it and not to use it.

You should use quotation only on duration and text

Top Labels in this Space