I building a custom form off a SharePoint list that has about 20 yes/no fields and a text field named Total Points. What I want to do is on the PowerApps form, use toggles for the Yes/No fields and set them up so that if the toggle is selected/yes, one point is added to Total Points. If a toggle is unselected/no, then one point is subtracted from the total.
I've tried to do this using a global variable and incrementing/decrementing it using the On Check and On Uncheck function on the toggle fields. So when the app opens the variable is set to 0, then if Toggle A is selected the On Check function uses the following to increment the variable:
Set(varPoints, varPoints+1)
If the user turns off the toggle, the On Uncheck formula is Set(varPoints, varPoints-1)
The Total Points field is getting updated as I expected. But when I edit an item when the form opens it's incrementing the Total Points without any action on my part, adding to it. It's as if the app is checking and sees that some toggles are selected and adding 1 for each one selected.
I'm trying to have the form open with the Total Points showing based on the number of toggles selected and not change unless a change is made to a toggle.