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 / Clear Gallery filter w...
Power Apps
Answered

Clear Gallery filter with button

(0) ShareShare
ReportReport
Posted on by 19

I use below filter to filter gallery based on 2 dropdown selection. I am try to set a button "OnSelect" to clear this filter and show all items in gallary. Here is filter currently in galary:

Sort(Filter(KPI, Unit.Value = Dropdown1.Selected.Value, KRA.Value= Dropdown2.Selected.Value),Title, Ascending)

 

I would appreciate some help to implement this button. By the way, i am a rookie 🙂

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

    Hi @Fred1411 ,

    Put this on the OnSelect of the button

    UpdateContext({varAll:!varAll})

    then your Filter

    Sort(
     Filter(
     KPI, 
     If(
     varAll,
     true,
     Unit.Value = Dropdown1.Selected.Value && 
     KRA.Value= Dropdown2.Selected.Value
     )
     ),
     Title, 
     Ascending
    )

     

    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.

     

  • Fred1411 Profile Picture
    19 on at

    Thank you Warren. It works well as expected but with a delegation warning. Also when i click button, (shows all records) but if i select any comboboxes, it wont filter on its own until i click the button again. Therefore, i would need to find a way if this button's display name can be renamed after clicking, for example, from "show all" and then to "enter" maybe. Thank you very much for your time.

  • WarrenBelz Profile Picture
    154,910 Most Valuable Professional on at

    Hi @Fred1411 ,

    I am not sure what the Delegation warning is as these are text values, however to your question - put this on the Text of the Button

    If(
     varAll,
     "Select to use Filter",
     "Select all records"
    ) 

    or whatever message you want - basically the text is the opposite of the setting and clicking the button then produces what is shown on it.

     

    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.

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 528

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard