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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter and sort galler...
Power Apps
Unanswered

Filter and sort gallery based on Priority value like "High, Medium, Low"

(0) ShareShare
ReportReport
Posted on by 12

Hello, 

 

I want to filter and sort the data based on Priority value like High medium and low. 

 

Currently I am able to sort the data ascending using below code. 

 

My code is - SortByColumns(Filter('Test SharePoint list', 'Approval Status'. Value = "Pending" Or 'Approval Status'. Value = "New Request" Or 'Approval Status'. Value = "Rejected"), " Request Priority ", Ascending, "ID", Ascending) 

 

Please can you help on this. 

 

Thanks!! 

Categories:
I have the same question (0)
  • CU-18081211-6 Profile Picture
    9,270 Moderator on at
    SortByColumns(
     Filter('Test SharePoint list', 'Request Priority'. Value = "High" Or 'Request Priority'. Value = "Medium" Or 'Request Priority'. Value = "Low"), 
     "Request Priority", 
     Ascending, 
     "ID", 
     Ascending
    ) 
  • powerappsrooki Profile Picture
    12 on at

    Nope it is not working, I want to Sort the data based on priority. Filter condition is working fine. Thanks for your prompt response. 

  • timl Profile Picture
    36,713 Super User 2026 Season 1 on at

    Hi @powerappsrooki 

    I suspect this is what you're looking for:

    Sort(
     Filter('Test SharePoint list', 
     'Approval Status'. Value = "Pending" Or 
     'Approval Status'. Value = "New Request" Or 
     'Approval Status'. Value = "Rejected"
     )
     , 
     Switch('Request Priority', 
     "High", 1, 
     "Medium", 2, 
     "Low", 3, 
     4)
    )
  • powerappsrooki Profile Picture
    12 on at

    @timl  thanks for your reply . It not working as expected. 

     I want to sort the gallery based on Priority first as mentioned above and then by ID column. All the High priority record come on top then medium, low. After that based on ID, oldest record show on top. 

  • timl Profile Picture
    36,713 Super User 2026 Season 1 on at

    @powerappsrooki 

    If you want to sort by multiple columns, this is the syntax you would use.

    SortByColumns(
     AddColumns(
     Filter('Test SharePoint list', 
     'Approval Status'. Value = "Pending" Or 
     'Approval Status'. Value = "New Request" Or 
     'Approval Status'. Value = "Rejected"
     ),
     "PriorityValue",
     Switch('Request Priority', 
     "High", 1, 
     "Medium", 2, 
     "Low", 3, 
     4)
     ),
     "PriorityValue", Ascending,
     "ID", Ascending
    )

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard