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 / Filtering with choice ...
Power Apps
Unanswered

Filtering with choice column powerapps gallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi guys,

 

Below is a photo of my powerapp. i'm trying to be able to filter so that when pressed, the gallery will only show items that have the choice "approved" or "Pending" when the appropriate button is pressed.

CMQuills_0-1687351718077.png

my button currently has this code:

 

 

UpdateContext({FilterByApproved:!FilterByApproved})

 

 

 

and my gallery currently has this code:

 

 

SortByColumns(
 Filter(
 'Expense List',
 (If(FilterByApproved = true, Text(Approval.Value) = "Approved", Approval.Value <> "") || (Approval.Value = "Pending" Or Approval.Value = "Approved" Or Approval.Value = "Rejected")) && Text(Submitter) = User().FullName
 ),
 "Date",
 If(SortDescending, SortOrder.Descending, SortOrder.Ascending)
)

 

 

 

 

I've also in the approved button above tried the following code but to no avail:

 

 

ClearCollect(
 FilteredItems,
 Filter(
 'Expense List',
 (
 Approval.Value = "Approved" 
 )
 ))

 

 

Note: Id want to do this for all buttons i.e. not just approved but also pending and all. The choice column in SP is named 'Approval'

Let me know if you can help! 

 

Thanks,
Cormac

Categories:
  • developerAJ Profile Picture
    4,763 on at

    on button select you can use UpdateContext({btnFilterSelection:"Approved"}) ; UpdateContext({btnFilterSelection:"Pending"});UpdateContext({btnFilterSelection:"All"})

     

     

     SortByColumns( Filter( 'Expense List', IsBlank(btnFilterSelection)|| btnFilterSelection="All" || If(btnFilterSelection="Pending",Approved.Value="Pending",Approved.Value="Approved") ,Text(Submitter) = User().FullName ), "Date", If(SortDescending, SortOrder.Descending, SortOrder.Ascending) ) 

     

    Please click Accept as solution and Thumbs Up. 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.

    You can connect with me on LinkedIn

     

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hi @developerAJ ,

     

    I've added the code into the gallery and put the update context in one of the buttons eg. pending button code is UpdateContext({btnFilterSelection:"Pending"}) however the gallery comes out empty. do you know what causes this?

    CMQuills_0-1687359841811.png

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard