cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
luisabsg
Helper V
Helper V

Clean filters using a button

Hello. How can I clean my filters using a button?

luisabsg_0-1641477222595.png

I tried to do it as follows, on the button I put the code:

 

// Define default filter values
Set(varDefaultFilters; {
Phase: Blank();
PM: Blank()

});;
Reset(Dropdown1);;
Reset(Dropdown2)

 

and in the dropdown, I used:

luisabsg_1-1641477341520.png

but doesn't work 😞

 

Filter in my gallery:

luisabsg_2-1641477376666.png

 

can someone help me pls?

1 ACCEPTED SOLUTION

Accepted Solutions


@luisabsg wrote:

Hey, tks for the answer 

Option 2. I don't know how to do this


Try something like this in the Items property of the gallery:

If(varFilterToggle;
    Filter('scorecard 2.0'; 
        'PM Initials' = Dropdown1.Selected.Result;
        Phase = Dropdown2.Selected.Result
    ); // Filtered results when varFilterToggle = true
    'scorecard 2.0' // Unfiltered results when varFilterToggle = false
);;
// Use Set() or UpdateContext() to change varFilterToggle between true and false

 

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
BCLS776
Super User
Super User

Hi, "cleaning" your filter could mean a couple of things:

  1. Are you trying to reset your dropdowns back to their default values? If so, use the Reset() function on each control you want to return to its default state.
  2. Or, are you trying to implement a toggle that turns your Filter() statement on and off? When off, no filter is applied? If so, consider using an If() statement that uses a true/false variable as its condition and either returns a filtered table or the unfiltered one.

Does that help?

Bryan

 

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

Hey, tks for the answer 

Option 2. I don't know how to do this


@luisabsg wrote:

Hey, tks for the answer 

Option 2. I don't know how to do this


Try something like this in the Items property of the gallery:

If(varFilterToggle;
    Filter('scorecard 2.0'; 
        'PM Initials' = Dropdown1.Selected.Result;
        Phase = Dropdown2.Selected.Result
    ); // Filtered results when varFilterToggle = true
    'scorecard 2.0' // Unfiltered results when varFilterToggle = false
);;
// Use Set() or UpdateContext() to change varFilterToggle between true and false

 

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

ok its work ! thanks

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,737)