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
Super User
Super User

Re: Removing Selected Items Based on Dropdown

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

Re: Removing Selected Items Based on Dropdown

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?

Super User
Super User

Re: Removing Selected Items Based on Dropdown

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
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (4,329)