web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How would I get a drop...
Power Apps
Unanswered

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:
I have the same question (0)
  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    Hi @Future_Vision ,

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

  • Future_Vision Profile Picture
    634 on at

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

  • Verified answer
    Al_10 Profile Picture
    1,691 Super User 2024 Season 1 on at

    @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

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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard