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.
Have you tried adding a Reset to the OnChange property of the dropdown?
Example: If(Dropdown1.Selected.Value = "b", Reset(combobox1))
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).
Check out new user group experience and if you are a leader please create your group
Check out how to claim yours today!
Test your skills now with the Cloud Skill Challenge.
We are excited to announce that Demo Extravaganza for 2021 has started!
On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks