web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Make login persistent ...
Power Apps
Unanswered

Make login persistent if user closes the app (Collections not allowed in StartScreen)

(0) ShareShare
ReportReport
Posted on by 40

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

Categories:
I have the same question (0)

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.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard