Hello,
I am attempting to use SortByColumns in a Gallery in the following way (see code snippet below) - I want to first sort by Status, but it is not sufficient from a business standpoint to sort by ascending or descending order. Thus, I specified the order I would like the Status field sorted by defining values in a comma separated list.
Then, I want to subsort by timestamp (a date field) descending. End state, I would ideally end up with all 'Unclaimed' items first, subsorted from most recent to least recent timestamp, then all 'Claimed' items, subsorted from most recent to least recent timestamp, and so on.
Power Apps throws a syntax error with the below formula, saying that the SortByColumns function has invalid arguments, but by my eyes I am following the syntax outlined in the documentation (https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-sort).
Is this a limitation of the SortByColumns function, that it cannot combine two kinds of sortorder methods (i.e. one specifying your values in a list, and one simply ascending/descending)? Or am I missing something?
If it is a limitation, am I able to use Sort to accomplish this somehow or has anyone crafted a way to code around this?
Thanks to anyone for any help you can provide!
Alex
SortByColumns(
<Table>,
"Status",
[
"Unclaimed",
"Claimed",
"Pending",
"Completed",
"Cancelled"
],
"Timestamp",
Ascending
)