AppSheet displays a dropdown for fields having a Valid_If constraint that yields a list of values.

The Valid_If expression can be:

1. A List of Constant Values

For example: {100, 200, 300} 

Whenever a list of allowed values is provided, it is actually a syntactic shorthand for an expression that uses the IN function. For example, {100, 200, 300} is the same as IN([_THIS], {100, 200, 300}).

2. A List of Values from a Column in Another Table

For example: LookupTable[ColumnC]

Where "LookupTable" is the name of the table containing the dropdown values, and "ColumnC" is the name of the column containing the dropdown values.

This is particularly useful if the list of allowed values can change while the app is being used.

3. A List of Values from a Column in Another Table Where the Rows in that Table are Filtered

For example: SELECT(LookupTable[ColumnC], [ReportDate] > Today() - 7) 

Where "LookupTable" is the name of the table containing the dropdown values, and "ColumnC" is the name of the column containing the dropdown values. "[ReportDate] > Today() - 7" is an expression which filters the rows in the table to those where ReportDate is within the last week. The resulting values in ColumnC of LookupTable become the allowed list of valid values.

4. A Sorted List of Values from a Column in Another Table

For example: SORT(LookupTable[ColumnC])

Where "LookupTable" is the name of the table containing the dropdown values, and "ColumnC" is the name of the column containing the dropdown values.

The list of values is sorted in ascending order. If it should be in descending order instead, use SORT(LookupTable[ColumnC], true).

Valid_If dropdowns on Ref columns

Valid_If can also be used to modify the dropdown of a Ref column (to filter the available options, for example), but there are some additional considerations to be aware of. 

Did this answer your question?