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.
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?
Yes. Reset(). Completely forgot about that function and of course I should have said OnChange and not OnSelect. OnSelect makes no sense.
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)
@PriyankaGeethik
How best to do that? OnSelect of Brand 2? Maybe something like if it is blank OnSelect then set Brand 3 to blank?
Hi @Future_Vision ,
With Blank values in the dropdown try to reset the dependent dropdowns.
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional