cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
pepeday
Level: Powered On

Filtering a gallery with a drop down

So this isn't a question, it's a bit of a workaround I came up when wanting to filter a gallery using a dropdown.

The main problem faced was how to disable the filter, as in give the option to the user to turn the filter on and off. The easiest way I've found is as below.

Filter(collection, item_id=item_id*!toggle. Value+dropdown.selected.item_id*toggle.value).

How the above works is when the toggle is set to off, the item_id is set equal to item_id, and as such all the records are shown. If it's set to on, item_id is set to equal the selection of the dropdown, voila!

There's a couple of caveats, essentially if there are records that the item_id is set to 0 or blank then these show up whether is filter is enabled or not.

On the other hand, the coding is very streamlined and there's no delegation warnings with this method (so I assume that the formula is delegable).

That's all.
2 REPLIES 2
Super User
Super User

Re: Filtering a gallery with a drop down

Hi @pepeday,

I like to use a context variable to create an alias for the entire formula using the UpdateContext() Function. I then use the variable as the Items property of a gallery. I then can redefine the variable easily as the OnSelect property of a button, checkbox, toggle or icon by substituting another formula in the UpdateContext() function.

pepeday
Level: Powered On

Re: Filtering a gallery with a drop down

Touch of genius right there! Can also work much better in some cases than my solution. Awesome and thanks @Drrickryp

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 29 members 3,850 guests
Recent signins:
Please welcome our newest community members: