Skip to main content
Community site session details

Community site session details

Session Id : wPaWL31FQFljRDvfJz7H+b
Power Apps - Building Power Apps
Unanswered

Saving Login Credentials for custom Login Page

Like (0) ShareShare
ReportReport
Posted on 17 Nov 2021 05:12:11 by 422

Hello All,

 

I have one requirement on my App , i want to save login details for the next login so that no need to enter the credentials again by user. 

SachinG31_0-1637125653192.png

On my login page user name is a combo box which pick data from SQL table ,user search for their name and chose it.

Password is a text box field.

I believe this should be possible by SaveData () function and collection , but how to achieve that i am not sure. if anyone knows any better approach than this please advise.

user use App in their phone , so last login details should be picked automatically.   

 

  • Pablo Roldan Profile Picture
    294 on 18 Nov 2021 at 22:56:22
    Re: Saving Login Credentials for custom Login Page

    Hi, regarding your issues:

    1.- your controls will have a horrorific red x. As is experimental in the editor mode is ok to be shown.

    2.- must set the value

    LoadData(colSession,"SessionUser")

    OnVisible of your Screen1, my bad I edited the last message.

    3.- Storing it in the backend could be a better choise in powerapps, The data saved with SaveData is not encrypted. But all depends on your architecture, requeriments, etc..

     

    regards.

  • SachinG31 Profile Picture
    422 on 18 Nov 2021 at 08:03:10
    Re: Saving Login Credentials for custom Login Page

    Hello @PabloRoldan ,

     

    Thanks for looking into this issue , i applied your solution but its not working as expected. below are the findings.

    1.Runtime Error : Data cannot be saved when running in a web browser

    2. I did not find PROPERTY:OnVisible, on canvas app so i set the load data on property ONStart

    3.If we will not store this session details (username , Password ) somewhere at backend , after refreshing or killing the App it will again show the default username and no filled password. which is very frequent in my case

     

    Please mention your comment on this

  • Pablo Roldan Profile Picture
    294 on 17 Nov 2021 at 16:41:46
    Re: Saving Login Credentials for custom Login Page

    Hi, Currently what you need is not supported(A Session Cookie) by MS Power Apps, you'll need to store that session in another SQL Table or Excel Sheet.

     

    By using SaveData and LoadData could do the trick but it's an Experimental feature:

    steps: 
    Turn it on

    PabloRoldan_0-1637165710696.png

     

    with your form like this set this formulas

    PabloRoldan_1-1637167027707.png

     

    PROPERTY:DEFAULT 
    CONTROL:TextInput User 
    ValueFormula:First(colSession).user
    
    PROPERTY:DEFAULT 
    CONTROL:TextInput Password
    ValueFormula:First(colSession).password
    
    PROPERTY:OnSelect
    CONTROL:Button Login
    ValueFormula:
    ClearCollect(colSession,{user:txt.Text,password:pwd.Text});
    SaveData(colSession,"SessionUser");
    
    PROPERTY:OnVisible
    CONTROL: YOUR_CURRENT_CREEN e.g:Screen1 
    ValueFormula:LoadData(colSession,"SessionUser")

     

    regards

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete