Hi @RodrigoSifon ,
If you want to save the state of the checkbox so that it persists across sessions (i.e., even when the user closes and reopens the app), you'll need a mechanism to store and retrieve this information. One way to achieve this is by using some form of external storage, such as a SharePoint list, or a database.
For a more permanent solution, you could consider using a SharePoint list or an external database to store the checkbox state.
- Create a SharePoint list with two columns: 'ID' and 'CheckboxState'.
- On the OnStart property of your app, retrieve the checkbox state from the SharePoint list:
ClearCollect(CheckboxState, SharePointListName)
- Set the Default property of your checkbox based on the value stored in the collection:
LookUp(CheckboxState, ID = "YourAppID").CheckboxState
- Set the OnCheck and OnUncheck properties of your checkbox to update the SharePoint list:
// OnCheck
Patch(SharePointListName, LookUp(SharePointListName, ID = "YourAppID"), { CheckboxState: true })
// OnUncheck
Patch(SharePointListName, LookUp(SharePointListName, ID = "YourAppID"), { CheckboxState: false })
Replace "YourAppID" with a unique identifier for your app. With this setup, the checkbox state will be stored in the SharePoint list, and it will persist across app sessions.
Thanks!!!
Please consider marking my response as the accepted solution if it successfully resolves your concern. If you found the information beneficial in other aspects, kindly express your appreciation by giving it a thumbs-up.