
Hello Experts,
I am trying to use sorting (from latest to oldest using Start Date) in my gallery and I want to combine these functions, but I can't seem to get it to work and there is an error using Sort and SortbyColumns.
Below is my code, the gallery is set to show by tabs.
If(varTab="Pending",
Filter(Tasks, 'Tasks (Views)'.'Pending Tasks' StartsWith(Subject, searchBoxA.Text))
,
varTab="History",
Filter(Tasks, 'Tasks (Views)'.'My Completed Tasks', StartsWith(Subject, searchBoxA.Text)))
Any help is appreciated!
Thank you!
Hi @Anonymous ,
If the 'Start Date' field is included in 'Tasks (Views)'.'Pending Tasks' and 'Tasks (Views)'.'My Completed Tasks'
Try this formula:
Sort(
Switch(
varTab,
"Pending",
Filter(Tasks, 'Tasks (Views)'.'Pending Tasks' StartsWith(Subject, searchBoxA.Text)),
"History",
Filter(Tasks, 'Tasks (Views)'.'My Completed Tasks', StartsWith(Subject, searchBoxA.Text))
),
'Start Date',
Descending
)
Hope it helps !