Hello,
For the sake of simplicity, my PowerApps component contains a text input control and a toggle control. Two instances of the component are inserted in a screen.
What I would like help with is how to set both toggle controls to false with one button. Otherwise, "false" is the default parameter of the toggle in the component setup, so somehow a reset would be the goal.
Thanks,
Zoltan
Thanks @graeme_findlay and @hasnainhaider68
This was the key:
"UpdateContext({ResetToggle: true})
UpdateContext({ResetToggle: false})"
It does not work with a single line.
Dear,
you should try this
Create a Reset Button: Add a button control to your PowerApps screen. This button will be used to trigger the reset action for both toggle controls.
Set the Reset Button's OnSelect Property: Select the reset button, and in the formula bar or the "OnSelect" property of the button, add the following formula:
UpdateContext({ResetToggle: true})
UpdateContext({ResetToggle: false})
This code snippet first sets the "ResetToggle" context variable to true, and then immediately sets it back to false. This will trigger a recalculation of the "ResetToggle" variable and cause the toggle controls to reset.
Thanks for the replies.
The toggle is part of the component, not a standalone control. I assume that something needs to be set in the custom properties.
Hi,
Alt, you can create 2 variables on the button like such (onselect):
Set(var1, false);
Set(var2, false);
and then set the default property on toggle 1 to "var1" and toogle 2 to "var2".
-------------------------------------------------------------------------
If this is the answer for your question, please mark the post as Solved.
If this answer helps you in any way, please give it a like.
MS.Ragavendar
32
Michael E. Gernaey
19
Super User 2025 Season 1
Rajkumar_M
16
Super User 2025 Season 1