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 / How to filter or sort ...
Power Apps
Answered

How to filter or sort a SharePoint gallery 3 ways on a button press

(0) ShareShare
ReportReport
Posted on by 364

Hi all, 

 

I have an app with a gallery that shows data from a SharePoint list.  Users submit a form on one page to request an approval, and their submission can either be "Pending", "Approved", or "Rejected" on our SharePoint site. My Gallery page currently displays all the items on that SharePoint site, but I want to be able to have users sort the Gallery and only see items for the status they have chosen. I will include some pictures below of what I have, I'm thinking that 3 buttons would be fine (each button filtering by one status) but I haven't been able to get any buttons to filter the gallery. 

 

Any suggestions? 

Capture1.PNG

Capture.PNG

 

I've tried using a variable, but I'm not very experienced with them and unsure of what to try. I got this code error free: 

UpdateContext({var1:Filter(Aurora_Engineering_Standard_Components, Text(Approval_Status) ="Pending")})

but I'm not sure if it'll help do what I want. 

 

Thanks for any help!

 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    154,797 Most Valuable Professional on at

    Hi @Aurora ,

    You need to set a Variable on each button OnSelect (example)

    UpdateContext({varFilter:"Pending"})

    and the Items of your Gallery

    Filter(
     Aurora_Engineering_Standard_Components, 
     Approval_Status = varFilter
    )

     

    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.

    Visit my blog Practical Power Apps

  • Aurora Profile Picture
    364 on at

    @WarrenBelz 

     

    I added buttons with the OnSelect properties set to your formula. Now that I've changed the Items property of my gallery, nothing is showing up. Not sure if I need to change one of the formulas, do you have any other suggestions? 

     

    2Capture.PNG

     

    3Capture.PNG

    Thank you for the help.

  • Aurora Profile Picture
    364 on at

    @WarrenBelz 

    I'm not sure if it matters, but "Pending", "Approved", and "Rejected" are all choices from a SharePoint column, so I don't know if they are recognizable as text. 

  • Aurora Profile Picture
    364 on at

    @WarrenBelz 

     

    I set the formula to

    Filter(Aurora_Engineering_Standard_Components_1,
    Approval_Status.Value = varFilter
    )

     

    And it works now, thank you for the help!

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard