Hi,
I have a button intended to reset a combo box selection in a 2-step fashion:
1. It resets the selection
2. It re-initializes a collection created following an OnChange on the combo box (which I needed to allow a many-to-many selection, see Many on Many Filter - Power Platform Community (microsoft.com) very useful)
Namely, the onSelect of the button goes as:
Reset(comboMZ); //
ClearCollect(colComboSelection, originalSharepointList);
That works fine, but requires to press the button twice.. so really that doesn't work fine.
Any suggestion as how I could circumvent that?
Thanks in advance
CBO
Solved! Go to Solution.
Hi @CBO29 ,
The problem seems to be that the Reset() function triggers the OnChange property of the ComBo Box Control.
Maybe you could consider setting a variable.
I have made a test for your reference.
1. Add a Combo Box Control and apply the following formula on its OnChange property as:
If(var=1, ClearCollect(colComboSelection, "A","B","C"),ClearCollect(colComboSelection, ComboBox1.SelectedItems));Set(var,0)
2. Add a Button Control and apply the following formula on its OnSelect property as:
Reset(ComboBox1);Set(var,1)
Result:
Best Regards,
Charlie Choi
Hi @CBO29 ,
The problem seems to be that the Reset() function triggers the OnChange property of the ComBo Box Control.
Maybe you could consider setting a variable.
I have made a test for your reference.
1. Add a Combo Box Control and apply the following formula on its OnChange property as:
If(var=1, ClearCollect(colComboSelection, "A","B","C"),ClearCollect(colComboSelection, ComboBox1.SelectedItems));Set(var,0)
2. Add a Button Control and apply the following formula on its OnSelect property as:
Reset(ComboBox1);Set(var,1)
Result:
Best Regards,
Charlie Choi
Hi Charlie,
Sorry for the late answer as these are things I do on the side... But brilliant, this works perfectly and was the type of workaround I was looking for.
Many thanks
CBO
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
183 | |
46 | |
46 | |
34 | |
33 |
User | Count |
---|---|
254 | |
83 | |
78 | |
67 | |
66 |