Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

How would I get a dropdown to drop its value if a dependent dropdown is blank?

(0) ShareShare
ReportReport
Posted on by 634

I have a series of dropdowns that depend on a value being present in the previous one. For example the Brand 2 dropdown would not be enabled if Brand 1 dropdown was blank/empty. Same with Brand 3. It relies on Brand 2 having a value. But as you can see from the screengrab below I can go back and delete the value in Brand 2 and while Brand 3 becomes disabled it still holds a value.

 

Future_Vision_0-1628101186296.png

 

I've previously implemented something like this before but with combo boxes. i used this bit of code for the DefualtSelectedItems.

 

If(Self.DisplayMode=DisplayMode.Edit && !(IsBlank(Brand2_CB_1.Selected.crfeb_brandname)), {crfeb_brandname:Parent.Default}, Blank())

 

This worked great for combo boxes but now, using dropdowns, I do not have an option for DefaultSelectedIitems and using this code in the Default field doesn't work. I get an 'Expected Text value' error. How could I make that Brand 3 dropdowns not only dependent on the Brand 2 dropdown to be enabled but also to clear its value if the Brand 2 dropdown is reverted back to blank?

Categories:
  • Future_Vision Profile Picture
    634 on at
    Re: How would I get a dropdown to drop its value if a dependent dropdown is blank?

    Yes. Reset(). Completely forgot about that function and of course I should have said OnChange and not OnSelect. OnSelect makes no sense.

  • Verified answer
    Al_10 Profile Picture
    1,691 Super User 2024 Season 1 on at
    Re: How would I get a dropdown to drop its value if a dependent dropdown is blank?

    @Future_Vision 

     

    ddBrand1.OnChange = If(IsBlank(Self.Selected.Value), Reset(ddBrand2); Reset(ddBrand3);)

    ddBrand1.AllowEmptySelection = true

    ddBrand1.default = (empty)

     

    ddBrand2.OnChange = If(IsBlank(Self.Selected.Value), Reset(ddBrand3);)

    ddBrand2.displaymode = If(!IsBlank(ddBrand1.Selected.Value), DisplayMode.Edit, DisplayMode.Disabled);

    ddBrand2.AllowEmptySelection = true

    ddBrand2.default = (empty)

     

    ddBrand3.DisplayMode = If(!IsBlank(ddBrand2.Selected.Value), DisplayMode.Edit, DisplayMode.Disabled)

    ddBrand3.AllowEmptySelection = true

    ddBrand3.default = (empty)

     

  • Future_Vision Profile Picture
    634 on at
    Re: How would I get a dropdown to drop its value if a dependent dropdown is blank?

    @PriyankaGeethik 
    How best to do that? OnSelect of Brand 2? Maybe something like if it is blank OnSelect then set Brand 3 to blank?

  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at
    Re: How would I get a dropdown to drop its value if a dependent dropdown is blank?

    Hi @Future_Vision ,

    With Blank values in the dropdown try to reset the dependent dropdowns. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard