Announcements
Hey,
I've currently designed a log-in function and I'd like to make a "remember me" function for powerapps (Mobile app). The simple goal is to remember if the variable varLoggedIn is true or false upon application start. I'm guessing it works via SaveData and LoadData however I'm unable to figure out how this exactly works. Most tutorials online simply feature the basics of logging in without touching the subject of staying logged in even when the app is closed.
Thanks in advance,
// Thomas
There is no specific event that takes place if the app closes normally. So the key to accomplishing what you want is to use LoadData in the OnStart and then SaveData whenever something in the app changes the value of the variable, for example if the user Logs out. That way OnStart will always pick up the last known version of the variable.
Right, however I simply don't really get how the SaveData works. I've got the following:
Set(varLogIn; !varLogIn);; SaveData(varLogIn; "MyCache")
However this is incorrect. How would a simple variable be stored within the collection?
You can store a variable as a value in a record in a collection.
SaveData(varLogin; {value: varLogIn})
But there really is no need for a separate login function since a user must be logged in to use the app in the first place. Why are you implementing a Login functionality?
The application will be accessable for everyone in the team and only supervisors + will log-in for extra features.
(Teams groep)
How many supervisors? I would just create a list in SharePoint and have the app check the user().email against that list to determine if they are a supervisor.
A better and safer way to do this!
I've changed the code, thanks a lot!
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 397 Super User 2026 Season 2
Mohsin Ali 354
WarrenBelz 232 Most Valuable Professional