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

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
JRaasumaa
Level 10

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.

 

 

designAV
Level: Powered On

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,257)