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

Filtering Gallery by Multiple Dropdown boxes

Hi everyone,

 

I'm still having an issue filtering a gallery on my app and I'm hoping someone can help. Please read the discussion in the link below, it's quite short!

 

 

https://powerusers.microsoft.com/t5/General-Discussion/Filter-gallery-based-on-multiple-dropdowns-Da...

 

Thanks heaps!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @v-yamao-msft,

 

Thanks very much for your advice. I managed to find a similar solution that worked:

Filter(StudentActivity, If(IsBlank(YearDrop.Selected.Value), true, Year=YearDrop.Selected.Value) && If(IsBlank(TermDrop.Selected.Value), true, Term=TermDrop.Selected.Value) && If(IsBlank(SectionDrop.Selected.Value), true, Section=SectionDrop.Selected.Value) && If(IsBlank(RegionDrop.Selected.Value), true, Region=RegionDrop.Selected.Value) && If(IsBlank(SchoolsDrop.Selected.Value), true, School=SchoolsDrop.Selected.Value) && If(IsBlank(ActivityDrop.Selected.Value), true, Activity=ActivityDrop.Selected.Value))

 

 

Thanks again for the help!

View solution in original post

2 REPLIES 2
v-yamao-msft
Community Support
Community Support

Hi @ek21,

 

I made a test with an Excel table, but I assume that it can also be applied for Google sheet.


In the table, I have a blank row so that the dropdowns could be left without value.


Then on the app, add several dropdown controls(in my case, I added four) and a gallery control.


Set the four dropdown controls items property to:
Dropdown1: Table7.Year
Dropdown2: Table7.Section
Dropdown3: Filter(Table7,Section in Dropdown2.Selected.Section)
Dropdown4: Filter(Table7,Region in Dropdown3.Selected.Region)


Then set the gallery control’s Items property as:

If(IsBlank(Dropdown1.Selected.Value)&&IsBlank(Dropdown2.Selected.Value),Table7,Filter(Table7,Year=Dropdown1.Selected.Value&&Section=Dropdown2.Selected.Value&&Region=Dropdown3.Selected.Value&&Activity=Dropdown4.Selected.Value))


When there is no selection in the dropdown controls, all the items will be returned, otherwise, it will be filtered based on the selections in the dropdowns.


Please take a try with it.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yamao-msft,

 

Thanks very much for your advice. I managed to find a similar solution that worked:

Filter(StudentActivity, If(IsBlank(YearDrop.Selected.Value), true, Year=YearDrop.Selected.Value) && If(IsBlank(TermDrop.Selected.Value), true, Term=TermDrop.Selected.Value) && If(IsBlank(SectionDrop.Selected.Value), true, Section=SectionDrop.Selected.Value) && If(IsBlank(RegionDrop.Selected.Value), true, Region=RegionDrop.Selected.Value) && If(IsBlank(SchoolsDrop.Selected.Value), true, School=SchoolsDrop.Selected.Value) && If(IsBlank(ActivityDrop.Selected.Value), true, Activity=ActivityDrop.Selected.Value))

 

 

Thanks again for the help!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,740)