cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Filtering via multiple dropdowns

Hi, I have an app based on an Excel spreadsheet. It's quite a long list of products, making the app quite big to scroll through, so I've added a screen with two dropdown menus. I want to be able to filter the results based on two criteria - "Type" for product type, and "People" for number of users per product. All other fields will be displayed in the results but only two columns need to be searchable. I've got a Submit button, so ideally users would be able to filter using either or both of the dropdowns. Would love a little help as to the code I need to make it functional! Thanks

2 REPLIES 2
Highlighted
Memorable Member
Memorable Member

Re: Filtering via multiple dropdowns

If you add a few conditional statements to look at the dropdowns I find it works best.

 

You will also want the dropdowns filled with a "default" type of state, I usually have them say "All" as well as the filtered items (this doesn't work so well if you use a list from a table)

 

Then you simply have to do some comparisons to see what the values say.

 

If(Dropdown1.Selected.Value ="All" && Dropdown2.Selected.Value="All",

Note: This checks both dropdowns, display your full unfiltered collection if both say "All"

 

YourUnfilteredCollectionHere,

 

If(Dropdown1.Selected.Value<>"All",

Note:This is to check the first dropdown for All, if it's not we want to use it in our filter, but need to next check the other dropdown.

 

If(Dropdown2.Selected.Value<>"All",

Note:If this dropdown also does not equal "All" then we want to use it as well, so filter the collection using both.

 

FilterUsingBothDropdown1andDropdown2,

 

Note: If the 1st dropdown is the only change, filter using just that.

FilterUsingJustDropdown1

 

 

That should get you started.

 

 

Filter using bother dropdown values.

 

 

Highlighted
Helper I
Helper I

Re: Filtering via multiple dropdowns

Thanks for this @JRaasumaa! You will have to excuse my naivety, but where does this code need to go please? Also, would I not need some code that refernces the columns in my spreadsheet? Thanks for your time! 

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response 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 (6,147)