cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Building dependent dropdowns where blank = show everything or don't use that drop down

Hello All,

 

I can't seem to find a guide that covers everything I'm looking for here. I suspect I might not be using the right words to search though.

 

Anyways, I'm trying to build a simple vehicle inventory search like you might see on a local dealership websites. I'm using a Excel doc with a snippet of data. The idea would be you've got multiple drop downs tied to a gallery of vehicles. The first dropdown I've got selects the body type (sedan, SUV, etc) the second selects the make (Ford, Kia, etc) then model, etc etc. As you select stuff the filter shrinks whats shown in the gallery. At any point I should be able to leave a dropdown blank and that blank should display everything the previous filter hasn't filtered out. So for example, selecting Sedans and Chevrolet should show Chevy sedans like Cruze's and Malibu's if I keep the model drop down blank.

 

The best I could do was making all the dropdowns dependent on each other, but as soon as I make a selection, the rest of the drop down's auto select something. Using my example above, as soon as I select Sedan and Chevrolet the drop down immediately selects cruze or malibu. Now, I can select cruze or malibu and the gallery filters correctly, but I don't want it to just auto select.

 

1) How can I have the drop downs use a default of the blank row in the Excel doc and have that blank = "show everything"

2) How can I prevent the subsequent dropdowns from auto filling?

2) How can I prevent that blank row from showing up in the gallery? It displays as a blank vehicle.

 

This is a screenshot of the screen I'm talking about:

image.png

 

Below is the code from the body dropdown, then the make dropdown, and finally from the gallery:

 

Sort(Distinct(Table1_1, Body), Result)


(Sort(Distinct(Filter(Table1_1, Body = DBody.Selected.Result),Make),Result&Blank()))


Filter(Table1_1, If(IsBlank(DBody.Selected.Result), true, Body=DBody.Selected.Result) && If(IsBlank(DMake.Selected.Result), true, Make=DMake.Selected.Result) && If(IsBlank(DModel.Selected.Result), true, Model=DModel.Selected.Result) && If(IsBlank(DYear.Selected.Result), true, Year=DYear.Selected.Result) && If(IsBlank(DColor.Selected.Result), true, Color=DColor.Selected.Result))

 

 Thank you for reading through this. Let me know if you have any need for clarification. I'm very new to PowerApps.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@C_M_M_R_C 

Please consider changing your Gallery Formula to the following:

Filter(Table1_1, 
    (IsBlank(DBody.Selected.Result) || Body=DBody.Selected.Result) && 
    (IsBlank(DMake.Selected.Result) || Make=DMake.Selected.Result) && 
    (IsBlank(DModel.Selected.Result) || Model=DModel.Selected.Result) && 
    (IsBlank(DYear.Selected.Result) || Year=DYear.Selected.Result) && 
    (IsBlank(DColor.Selected.Result) || Color=DColor.Selected.Result)
)

 

1) How can I have the drop downs use a default of the blank row in the Excel doc and have that blank = "show everything"

Make sure your Dropdown has AllowEmptySelection set to true and set the Default property to Blank()

2) How can I prevent the subsequent dropdowns from auto filling?

See #1 answer

3) How can I prevent that blank row from showing up in the gallery? It displays as a blank vehicle.

See the above formula for your Gallery.

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

3 REPLIES 3
Super User III
Super User III

@C_M_M_R_C 

Please consider changing your Gallery Formula to the following:

Filter(Table1_1, 
    (IsBlank(DBody.Selected.Result) || Body=DBody.Selected.Result) && 
    (IsBlank(DMake.Selected.Result) || Make=DMake.Selected.Result) && 
    (IsBlank(DModel.Selected.Result) || Model=DModel.Selected.Result) && 
    (IsBlank(DYear.Selected.Result) || Year=DYear.Selected.Result) && 
    (IsBlank(DColor.Selected.Result) || Color=DColor.Selected.Result)
)

 

1) How can I have the drop downs use a default of the blank row in the Excel doc and have that blank = "show everything"

Make sure your Dropdown has AllowEmptySelection set to true and set the Default property to Blank()

2) How can I prevent the subsequent dropdowns from auto filling?

See #1 answer

3) How can I prevent that blank row from showing up in the gallery? It displays as a blank vehicle.

See the above formula for your Gallery.

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Good grief that was a simple solution. Thanks so much!

Super User III
Super User III

@C_M_M_R_C 

Best thing in PowerApps - Keep It Super Simple!!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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