Hi,
I am trying to clear the 2nd dropdown everytime the one of the left changes.
Ive tried
Clear(DataCardValue19.Selected.Value)
Reset(DataCardValue19)
Can anyone help?
Hi @wonka1234,
Indeed, in a form the combobox/dropdown names are DataCardValue[Number] - your Reset reference looks correct! 😊
The If statement should be written in the DefaultSelectedItems property of DataCardValue19.
Could you give that adjustment a try and see if it fixes the issue?
ah thanks. So the mode is set to Edit.
Now the reset should be the dropdown name - however it is a datacard, well both are choice datacards. Not a specific dropdown.
Would this change the code your are sharing? Ive tested it and it isnt clearing the 2nd dropdown.
DatacardValue15 (Dropdown a) - On change - Set(varResetDrp, true); Reset(DataCardValue19)
DataCardValue19 (Dropdown b) - Default - If(!varResetDrp, Parent.Default)
Hi @wonka1234,
When using this code in an EditForm with DefaultMode set to New, your Reset function should work. The dropdown1 should have the following code in the OnChange property:
//Replace with the correct DataCardValue name
Reset(DropdownName2)
In case the Form DefaultMode is set to Edit, we will need some additional logic since the second dropdown will have an auto-filled default value. The OnChange of dropdown 1 should be:
//Replace with the correct DataCardValue name
Set(varResetDrp, true); Reset(DropdownName2)
The DefaultSelectedItems property of dropdown 2 should be:
If(!varResetDrp, Parent.Default)
If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.
Thanks!
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional