Hi PowerApps Experts
I have a problem with reset of my toggle buttons - when making a new form, they don't reset, I want them all to be "off".
I use multiple screens after this format:
https://www.youtube.com/watch?v=N8AsxE__Mw8
It seems all my form are in "Edit" mode - why I can't use this formula I did when "only" using "New" & "Edit" modes:
If (EditForm1.Mode = FormMode.New,
false,
ThisItem.DataCard1
)
What to do?
BR
Bo
Hi
Made a bummer, my default in my SharePoint list was "default; On" - Doh!
Thanks for your reply and help ;0)
BR
Bo
Hi @Anonymous ,
Do you mean that when you open a new form, your toggle will not be reset?
The reason is that toggle is not a resettable control.
If you use ResetForm function or NewForm function, the toggle will not be reset. Using Reset function will not work neither.
So the solution is: set toggle's default based on form's mode.
I've made a similar test for your reference:
1)the edit button's OnSelect:
EditForm(Form1)
2)the add button's OnSelect:
NewForm(Form1)
3)the toggle datacard's Default:
If (Form1.Mode = FormMode.New,
false,
ThisItem.bb
)
//bb is my fieldname, please replace with your fieldname
the toggle's Default:
Parent.Default
Then if the form's mode is new, the toggle will be false by default. If the form's mode is edit, the toggle will be that field's value by default.
All the actions before will be cleared, which looks like reset toggle.
Best regards,
@Anonymous
Have you tried putting this code in the OnSelect property of a button?
ResetForm(EditForm1)
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
WarrenBelz
146,745
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional