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 / Buttons to filter a ga...
Power Apps
Answered

Buttons to filter a gallery

(0) ShareShare
ReportReport
Posted on by 147

Hi,

 

I have a gallery that i am filtering by using buttons placed above it.

The gallery contains a long list of staff, and the buttons are "Ward 1", "Ward 2", "Ward 3" and "All", which when pressed, update the gallery with a variable filter set to update to whichever button has been pressed

So on select of the ward 1 button is: Set(AllStaffGalleryFilter, "Ward 1"), and then in my gallery i have the items as: Filter(Shifts, 'Ward' = AllStaffGalleryFilter)

 

The ward 1/2/3 buttons work fine, but i can't figure what i need as the onselect formula for the "all" button, which i want to effectively clear the filter, and show every record regardless of that staff's ward.

 

Any ideas for how to make the 'all' button work?

 

Thanks

 

 

 

Categories:
  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    If(AllStaffGalleryFilter="All"
    ,Shifts

    ,Filter(Shifts, 'Ward' = AllStaffGalleryFilter)
    )

  • Verified answer
    eka24 Profile Picture
    20,925 on at

    Try:

    If(AllStaffGalleryFilter="All", Shifts,

    Filter(Shifts, 'Ward' = AllStaffGalleryFilter))

     

    That is if the variable AllStaffGalleryFilter is "All" then dont filter the Table Shifts

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    Put this code in the OnSelect Property of the All button

     

    Set(AllStaffGalleryFilter, "Ward 1")

     

    The use this code in the Items property of the gallery

    Filter(Shifts, ‘Ward’ = “All” Or 'Ward' = AllStaffGalleryFilter)

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • atray13 Profile Picture
    147 on at

    Great that has worked thank you

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard