cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AndyJJones
Frequent Visitor

Clear current selection from dropdown when another dropdown value changes

I have some dependant dropdowns that need to be cleared if the "parent" dropdown is changed. I have been prowling the forum to try to find an answer, but nothing seems to be working...

 

I have a dropdown for "Organization", then another dropdown for "Sub-Organization". If the Organization dropdown changes, I need to clear the selected item from the Sub-Organization since the old value no longer applies, and I need the user to reselct a new valid sub-organization.

 

These dropdowns are using filtered lists for the vlaues.

 

Any help would be greatly appreciated!

 

PowerappsShot1.png

1 ACCEPTED SOLUTION

Accepted Solutions
wyotim
Resident Rockstar
Resident Rockstar

You could try triggering the Reset property in the second dropdown.

 

In the OnChange property of the first dropdown, add something like:

UpdateContext({ResetDropdown: true}); 
UpdateContext({ResetDropdown: false})


In the Reset property of the second dropdown, add:

ResetDropdown

Please note that if you have a default condition set, this is what it will reset to. It is good to ensure that the AllowUnsetValue property is set to true in the second dropdown and that the Default is set to "" to allow a blank default entry.

View solution in original post

2 REPLIES 2
wyotim
Resident Rockstar
Resident Rockstar

You could try triggering the Reset property in the second dropdown.

 

In the OnChange property of the first dropdown, add something like:

UpdateContext({ResetDropdown: true}); 
UpdateContext({ResetDropdown: false})


In the Reset property of the second dropdown, add:

ResetDropdown

Please note that if you have a default condition set, this is what it will reset to. It is good to ensure that the AllowUnsetValue property is set to true in the second dropdown and that the Default is set to "" to allow a blank default entry.

View solution in original post

Thank you much for the direction!

 

It ended up being a bit more complicated that your example, but I ended up setting a "status" flag (ResetL2Status), and set the DefaultSelectedItems to:

If(IsBlank(ResetL2Status),Parent.Default,First(Sort(Distinct(Filter('Orgs',DataCardValue8.Selected.Result=L1),L2),Ascending)))

 

I think I am well on my way to getting this done now though.

 

Thanks again! 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,272)