Expression with Switch and OrderBy

tvinci
New Member

Hello AppSheet

I would like to alphabetize the Suggested_Values constraint for a column using ORDERBY().

I do not know why I am receiving errors. Does anyone else know?

Thank you.

-Tiffany

switch([Route Quickset],

"Mandatory AM Broward",orderby(select(locations[name],and([Route?]="Broward",[Mandatory AM?]="TRUE")),locations[name]),

0 3 216
3 REPLIES 3

Bahbus
New Member

ORDERBY( row-keys , sort-key [ , descending-order? [ , sort-key ] ]โ€ฆ )

row-keys: select(locations[name],and([Route?]=โ€œBrowardโ€,[Mandatory AM?]=โ€œTRUEโ€)) GOOD
sort-key: locations[name] INVALID - cannot be a list

sort-key (expression): an expression that produces a sort key for the row. The sort key is compared against the corresponding sort keys of other rows to determine where the row will occur in the sorted list. The expression is evaluated in the context of the row being considered (similar to the match expressions in FILTER() and SELECT() ). The simplest and most common sort-key expression is a reference to the column by which to sort (e.g., [Product Name] or [Start Date] ), but can be more complex.

So how do I create a sort-key indicating the alphabet? Thank you.

Please read the help doc.

Top Labels in this Space