web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Multiple sort/filters ...
Power Apps
Unanswered

Multiple sort/filters in gallery

(0) ShareShare
ReportReport
Posted on by 16

Hi, could anyone help with how to format the below so I don’t get errors? I am trying to do the following to my gallery: 

Search bar filter 

Combobox filter x 2 

Filter what can be seen so admin can see all but users can only see their own department.

Sort the gallery to the newest items are at the top.

Below is copied from the items part of my gallery: 

Sort(

    Filter(
        '0301 HQSW G6 BC App Reg',
        varReset && (StartsWith(Title,SearchbarOPBC_1.Text) && (Len(ComboBoxSystem2_1.Selected.Value) = 0 || System.Value = ComboBoxSystem2_1.Selected.Value) && (Len(ComboBoxStatus2_1.Selected.Value) = 0 || Status.Value = ComboBoxStatus2_1.Selected.Value) && (VarUserAdmin= true || Unit.Value = VarUserUnit.Value)
    ),
    Modified,

    SortOrder.Descending)

 

Thanks

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,462 Most Valuable Professional on at

    Hi @Ajam88 ,

    You are missing a bracket for a start

    Sort(
     Filter(
     '0301 HQSW G6 BC App Reg',
     varReset && 
     (
     StartsWith(
     Title,
     SearchbarOPBC_1.Text
     ) && 
     (
     Len(ComboBoxSystem2_1.Selected.Value) = 0 || 
     System.Value = ComboBoxSystem2_1.Selected.Value
     ) && 
     (
     Len(ComboBoxStatus2_1.Selected.Value) = 0 || 
     Status.Value = ComboBoxStatus2_1.Selected.Value
     ) && 
     (
     VarUserAdmin= true || 
     Unit.Value = VarUserUnit.Value
     )
     )
     ),
     Modified,
     SortOrder.Descending
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Ajam88 Profile Picture
    16 on at

    Hi @WarrenBelz, I seem to have real trouble with the filtering in gallery’s. You have helped me a few times with this so hoping you might be able to again. I have got a the following which throws no errors but it’s not having the desired impact, the final Filter piece is supposed to filter the text column when I type in the search box. But it’s not working. I am assuming it’s something to do with the earlier switch function but I can’t seem to get it sorted. Any help would be greatly appreciated! 

    Switch(locSortColumn, "Collection date", Sort('BC Loan Archive', Collectiondate, If(locSortAscending, SortOrder.Ascending, SortOrder.Descending)), "Return date", Sort('BC Loan Archive', Returndate, If(locSortAscending, SortOrder.Ascending, SortOrder.Descending)), Filter('BC Loan Archive',(StartsWith(Title, BdeRefSearch.Text))))

  • WarrenBelz Profile Picture
    153,462 Most Valuable Professional on at

    Hi @Ajam88 ,

    Try this

    With(
     { 
     wField:
     Switch(
     locSortColumn,
     "Collection date",
     "Collectiondate",
     "Return date",
     "Returndate"
     ),
     wOrder:
     If(
     locSortAscending, 
     SortOrder.Ascending, 
     SortOrder.Descending
     )
     },
     SortByColumns(
     Filter(
     'BC Loan Archive',
     StartsWith(
     Title, 
     BdeRefSearch.Text
     )
     ),
     wField,
     wOrder
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 421

#2
WarrenBelz Profile Picture

WarrenBelz 386 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 339 Super User 2025 Season 2

Last 30 days Overall leaderboard