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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,826)