Hi Guys,
I have an app with a toggle button which allows the user to hide or display another field, it is not working for me.
This is my setup:
Toggle on Check: Set(varAuditVisible, true)
Toggle on UnCheck: Set(varAuditVisible, false)
Audit Field Visibility: varAuditVisible
So far so good, switching the toggle will hide / display the audit card.
Now what I am trying to do is set the default value of the toggle button (when the form is in View mode then varAuditVisible should always = true and for New mode varAuditVisible should always = false), I have set it as follows:
Toggle Default: varAuditVisible
This is where things start going downhill. When I set the toggle to true and reload the screen, varAuditVisible flips between true / false repeatedly, it gets stuck in a loop. The same doesn't happen when I set the toggle to false and reload the screen. I can't work out what is going on.
On the button to create a new request I have added:
Set(varAuditVisible, false)
Thank you both for taking the time to reply. I was completely over thinking things
Hi, you don't need to set a variable as the toggle itself is true or false, therefore, the visible property can simply be toggle1.Value where toggle1 is your toggle name.
change the default value of the toggle to If(Form1.Mode = FormMode.New,false,true)
Hi @JimJim
Your current method is recursive. So just set the default property of Toggle control to
FormName.Mode=FormMode.New
In this case, for form new toggle is yes
WarrenBelz
146,605
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,946
Most Valuable Professional