cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Removing Selected Items Based on Dropdown

Hi all,

 

I currently have a dropdown and a combo box. My dropdown1 has two options a or b. My combobox1 has a variety of selectable answers. I would like to them up so when the user selects answer choice b in my dropdown, the combobox1 will hide and also deselect all previously selected items. I've got the hiding part down, as you just need to change the visible property to "If(Dropdown1.Selected.Value = "b", false, true)". I'm having trouble implementing the deselect action though. Has anyone run into this before/found a solution? Thanks in advance. 

3 REPLIES 3
Jeff_Thorpe
Super User
Super User

Have you tried adding a Reset to the OnChange property of the dropdown?

 

Example:  If(Dropdown1.Selected.Value = "b", Reset(combobox1))



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Anonymous
Not applicable

Your solution worked perfectly. The only thing I had to change to the statement was the syntax a little bit. The combobox didn't reset when the If statement wasn't completed: "If(Dropdown1.Selected.Value = "b", Reset(combobox1)". I had to 'complete' the if statment in a sense to rather be "If(Dropdown1.Selected.Value = "b", Reset(combobox1), false)". I also wanted to know is there any practical way to apply this on a larger scheme. For example I wanted to apply this accross 15 combo boxes, would there be a way that I could implement this functionality without adding 15 separate if statements to Dropdown1? 

 

Edit: Okay with further testing, I've found that this soultion only works on combo boxes that I create, not the automatically generated ones by PowerApps when I create an Edit Form linked to a SharePoint list. Is there a way to have it apply to both types of combo boxes or do I have to use a different statement for OnChange?

You should be able to string multiple reset() in the same if() by separating them with a semicolon.

 

Example: If(Dropdown1.Selected.Value = "b", Reset(combobox1);Reset(combobox2);Reset(combobox3), false).

 

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (68,069)