cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
davismarist1198
Regular Visitor

How to apply a All filter with many dropdowns

Hi,

I am currently trying to add "all" too many different drop-downs on my gallery's. Currently, I have multiple galleries, each linked to the other via a collection. Here is a examplel formula with 2 of my drop downs

Filter(Tsp,(Certsdd.Selected.Result= "All" And Rankdd.Selected.Result= "All") Or ('What is your current rank'=Rankdd.Selected.Result And Certsdd.Selected.Result= "All" ) Or ('certifications?' = Certsdd.Selected.Result And Rankdd.Selected.Result= "All") Or ('What is your current rank'=Rankdd.Selected.Result And 'certifications?' = Certsdd.Selected.Result))

 

This works as designed, the current issue is some pages that are linked to gallerys have more than two drop downs. Some have up to 10 drop downs for filters. Is there a way to stream line this filtering process. As it stands now I would need to write 49 lines of code for a page that has 7 drop downs to account for every combination. This is a very tedious process, do you have any process improvements or is there any way to loop through these drop downs? Below is a picture of my dropdown / app.

2 ACCEPTED SOLUTIONS

Accepted Solutions
iAm_ManCat
Super User
Super User

Heya,

 

Yes, you can simplify it in that you only want to filter in each case when something is selected, so add the 'all' as the alternate option as below here:

 

 

Filter(
   Tsp,
   // Either rank is all, or filter by rank
   (Rankdd.Selected.Result= "All" Or 'What is your current rank'=Rankdd.Selected.Result)
   ,
   // Either certs is all, or filter by cert
   (Certsdd.Selected.Result = "All" Or 'certifications?' = Certsdd.Selected.Result)
)

 

 

 

Cheers,

Sancho

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

Adam1986
Helper I
Helper I

Hi,

in my opinion best practice is to filter gallery by approach described below. If any of your dropdowns will be empty it will be omitted.

 

Filter(Tsp,
        ('What is your current rank' = Ranked.Selected.Result || IsBlank(Ranked.Selected.Result))
    &&  ('certifications?' = Certsdd.Selected.Result || IsBlank(Certsdd.Selected.Result)) && ...)

 

WIth this approach you can filter your gallery by any number of dropdowns. Just allow dropdown to have blank selection (AllowEmptySelection = true).

 

View solution in original post

2 REPLIES 2
iAm_ManCat
Super User
Super User

Heya,

 

Yes, you can simplify it in that you only want to filter in each case when something is selected, so add the 'all' as the alternate option as below here:

 

 

Filter(
   Tsp,
   // Either rank is all, or filter by rank
   (Rankdd.Selected.Result= "All" Or 'What is your current rank'=Rankdd.Selected.Result)
   ,
   // Either certs is all, or filter by cert
   (Certsdd.Selected.Result = "All" Or 'certifications?' = Certsdd.Selected.Result)
)

 

 

 

Cheers,

Sancho

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Adam1986
Helper I
Helper I

Hi,

in my opinion best practice is to filter gallery by approach described below. If any of your dropdowns will be empty it will be omitted.

 

Filter(Tsp,
        ('What is your current rank' = Ranked.Selected.Result || IsBlank(Ranked.Selected.Result))
    &&  ('certifications?' = Certsdd.Selected.Result || IsBlank(Certsdd.Selected.Result)) && ...)

 

WIth this approach you can filter your gallery by any number of dropdowns. Just allow dropdown to have blank selection (AllowEmptySelection = true).

 

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 (2,518)