
Announcements
Hello everyone.
I have built an app that has a login form as its landing page. Now, I want to make it so that the user only needs to log in once, instead of every time the app is opened.
I have tried using Collections coupled with SaveData and LoadData to do this, but unfortunately had no success.
My Login button has the following code to save locally that the user has already logged in:
Clear(StatusLogin);
Collect(StatusLogin, {IsUserLoggedIn: true});
SaveData(StatusLogin, "StatusLogin");
Set(TxtErroVisible, false);
My "App.OnStart" property hast the following code to load the information of whether the user has already logged in before.
Collect(StatusLogin, {IsUserLoggedIn: false});
Clear(StatusLogin);
LoadData(StatusLogin, "StatusLogin", true);
But when I try writing the following code in the "App.StartScreen" property I get the error "Collections are not allowed in StartScreen".
If(First(StatusLogin).IsUserLoggedIn, Menu, Login)
I have tried workarounds using global variables, but then I get the error "Global variables are not allowed in StartScreen".
What would be a valid way to do this?
Thanks in advance