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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

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

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,029)