cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Combining sort, filter and search using tabs

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!

1 REPLY 1
Super User II
Super User II

Hi @anonymia25 ,

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 !

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Solution Authors
Top Kudoed Authors
Users online (90,064)