Hi,
I'm farely new to powerapps but am involved in building an app for my University professor to enable him to schedule the work of his apprentices more easily.

The apprentices receives this gallery of scheduled work shifts. If the apprentice is available for work they just chech the toogle for that specific shift and the information is saved in an Azure database.
The problem is that when the powerapp is turned off, the toggle value is immediately turned to false. To solve this, I created a column in the database called ToggleValue, and whenever the Toggle is checked I use Patch to change the ToggleValue for that specific record to "True" and "False" when unchecked:
Patch('[dbo].[Timeedit_data]'; LookUp('[dbo].[Timeedit_data]';ID = ThisItem.ID);{ToggleValue: "True"}) Patch('[dbo].[Timeedit_data]'; LookUp('[dbo].[Timeedit_data]'; ID = ThisItem.ID);{ToggleValue: "False"})
I then set the Default value of the toggle to:
If(ThisItem.ToggleValue = "True"; true; ThisItem.ToggleValue = "False"; false)
This works fine when I check the toggles, except when I check the one connected to the first record in the gallery. When doing that it seems like a chain event is created that checks every single toggle.
Any ideas on why this is occurring? Any suggestions on altering the code to make this work?
Thanks,
Philip.