cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Clear filter from gallery

Hi all,

 

I have a gallery that has its records being filtered. I want is a button or something for the filter to be removed and for all records to display like they did before being filtered. When I select an item from Gallery1, items in the table that have a matching location display on Gallery2. Gallery1 is just a gallery that displays a list of locations. 

 

Gallery1- Items: 

Distinct(SortByColumns(Testing_Database,"Location"), Location)

 

Gallery2- Items:

Filter(Search(Testing_Database,'Textbox Search'.Text, "Artist","Title","Location","Medium","Nationality"), Location = Gallery1.Selected.Result)

 

I've also realized that the search bar searches the entire table instead of just the items being filtered when the user selects a filter. Of course, if the user selects a filter they would only want to search through the filtered list not the entire table. How can I fix this?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Memorable Member
Memorable Member

Re: Clear filter from gallery

If you want to search in filtered table then you have to put filter inside the search. Something like this

Gallery2- Items:
Search(Filter(Testing_Database,Location = Gallery1.Selected.Result),'Textbox Search'.Text, "Artist","Title","Location","Medium","Nationality")

For the button to cancel filtering and display whole table, insert button and in OnSelect proerty add

UpdateContext({filterOn:!true})

And in yout gallery items change it to something like this

If(filterOn=true, Search(Filter(Testing_Database,Location = Gallery1.Selected.Result),'Textbox Search'.Text, "Artist","Title","Location","Medium","Nationality"), TestingDatabase)

View solution in original post

2 REPLIES 2
Highlighted
Memorable Member
Memorable Member

Re: Clear filter from gallery

If you want to search in filtered table then you have to put filter inside the search. Something like this

Gallery2- Items:
Search(Filter(Testing_Database,Location = Gallery1.Selected.Result),'Textbox Search'.Text, "Artist","Title","Location","Medium","Nationality")

For the button to cancel filtering and display whole table, insert button and in OnSelect proerty add

UpdateContext({filterOn:!true})

And in yout gallery items change it to something like this

If(filterOn=true, Search(Filter(Testing_Database,Location = Gallery1.Selected.Result),'Textbox Search'.Text, "Artist","Title","Location","Medium","Nationality"), TestingDatabase)

View solution in original post

Highlighted
Frequent Visitor

Re: Clear filter from gallery

Thanks Sienna, it worked. Now the filter from the gallery can be cleared with a button and only the filtered results are being searched.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,959)