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 / Connect A Button to a ...
Power Apps
Answered

Connect A Button to a Gallery to Filter

(0) ShareShare
ReportReport
Posted on by 28

Hello, I'm trying to set up buttons to filter a list in a gallery. The list is connected to a SharePoint List, and the column is a choice column. I'm very new to power apps, but I have On Select set up as:

 

Filter ('Cleaning-Checklist', Area. Value = "Sorter")

 

but it is not connecting to the list in the gallery. 

 

When I put the filter into the items section in the gallery it works fine, but I want it to only filter when I click the button. 

 

Here's what it looks like:

Morgan_W_0-1695974331293.png

 

If you need more information, please let me know I cannot seem to figure this out. Thanks!

 

Categories:
I have the same question (0)
  • Verified answer
    Rajkumar_M Profile Picture
    3,747 Moderator on at

    Hi @Morgan_W 

     

    Set the OnSelect property of the button to the following formula:

     

    UpdateContext({FilterValue: "Sorter"})


    Modify the Items property of the gallery to include the filter condition:

     

    Filter('Cleaning-Checklist', Area.Value = FilterValue)

     

     

    Thanks!

     

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

  • Morgan_W Profile Picture
    28 on at

    Thank you so much!!! That worked perfectly. 

  • AndrewR1 Profile Picture
    1,572 Moderator on at

    Hi @Morgan_W I would do something like the following: 

     

    So on the on select of your button to set a variable Like: 

    Set(SortVar,"Sorter")

    (You would need to repeat this for each of your buttons)

     

    The Set the Items Property of the Gallery to: 

    Filter('Cleaning-Checklist',SortVar = Area. Value)

    Assuming that both values are text and not a choice field?  

     

    For my example I  used a choice field and I replaced the = with in operator but this is the same concept: 

    AndrewR1_0-1695976013560.png

     

    AndrewR1_1-1695976025797.png

     

    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. Remember, you can accept more than one post as a solution. If the content was useful in other ways, please consider giving it Thumbs Up.


    Thanks
    Andrew

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 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard