Hello community,
i have a small question. I have 4 Toggles, each of them is standard on yes. I want to make all four dependent on each other. At the beginning you only see the first Toggle. If this is set to no, the second Toggle is displayed. If you set the second Toggle to no, then the third is displayed. And so on. If now Toggles 1-3 are no and I change the first Toggle back to yes, then Toggle two and three are automatically hidden again. Everything works out to this point, but here is my problem. Toggle two and three are still set to no. They should actually jump to their default value yes if the previous Toggle (in this case the first one) is set to yes.
How is it possible to set the default value if for example the first Toggle is set again to yes? We can use his own visible value, for example if he is not visible then set value to yes (only for exmaple maybe there is a smarter solution).
I hope someone can help me with this problem.
Thank you.
Best regards
CD
Solved! Go to Solution.
Here is a slightly different way to do it by making changes in three properties (Visible, Default and OnChange).
Toggle Control |
Visible |
Default |
OnChange |
Toggle1 |
true |
true |
Reset(Toggle2) |
Toggle2 |
!Toggle1.Value |
true |
Reset(Toggle3) |
Toggle3 |
!Toggle2.Value |
true |
Reset(Toggle4) |
Toggle4 |
!Toggle3.Value |
true |
false |
Hi there,
I've just tried this and the following seems to work (and you can change the variable values to true or false depending on your needs). IN the following the variable I use is 'varA' but you can call this what you like.
On the first Toggle, set a variable on the 'OnChange' property.
If(Toggle1.Value=false, Set(varA,false));
If(Toggle1.Value=true, Set(varA,true));
Then on the secondary Toggles, set the 'Default' value to varA
You should be able to propagate this logic throughout your toggles to get the outcome you need.
Best of luck on your PowerApp journey!
Here is a slightly different way to do it by making changes in three properties (Visible, Default and OnChange).
Toggle Control |
Visible |
Default |
OnChange |
Toggle1 |
true |
true |
Reset(Toggle2) |
Toggle2 |
!Toggle1.Value |
true |
Reset(Toggle3) |
Toggle3 |
!Toggle2.Value |
true |
Reset(Toggle4) |
Toggle4 |
!Toggle3.Value |
true |
false |
@Jeff_Thorpe @AndrewGibson1 Thank you very much. I tried your solutions and it worked exactly the way i wanted it to 🙂
User | Count |
---|---|
252 | |
107 | |
88 | |
51 | |
44 |