How to Create Login Page in Power Apps Using SharePoint + Remember Me Option - Enjoy SharePoint (2024)

Automatically filling in the details when logging into an application frequentlycan be useful for quick access. This is possible by using the Remember Me feature/option during Power Apps login.

In this Power Apps article, I will show you how to create Login page in Power Apps using SharePoint and Remember Me option step by step.

Look at the gif below.

How to Create Login Page in Power Apps Using SharePoint + Remember Me Option - Enjoy SharePoint (1)

Table of Contents

How to Create Login Page in Power Apps Using SharePoint

Here, I have a SharePoint list called Event Registration Form that stores registered users’ UserID and Password credentials.

We’ll check the user credentials from this SharePoint list to log in to an application. If the user exists, it will successfully log in to some page. Otherwise, it will show an error.

How to Create Login Page in Power Apps Using SharePoint + Remember Me Option - Enjoy SharePoint (2)

Refer to the table below, which contains the above SharePoint list columns and their data type.

Column NameData Type
UserIDTitle(Single line of text)
PasswordSingle line of text
First NameSingle line of text
Last NameSingle line of text
Email AddressSingle line of text
Phone NumberSingle line of text
How to Create Login Page in Power Apps Using SharePoint + Remember Me Option - Enjoy SharePoint (3)

Follow the steps below to achieve this!

1. Create one blank Power Apps application. Then, add the following controls to the app.

  • Two Text Inputs – For UserID, Password.
  • Two Text labels – For UserID, Password.
  • One Button Control – For login.
  • Add User, Lock, and View icons if you want.

Design the screen with the above controls as shown below.

How to Create Login Page in Power Apps Using SharePoint + Remember Me Option - Enjoy SharePoint (4)

2. Now, connect with the SharePoint list from Data in the Power Apps navigation.

How to Create Login Page in Power Apps Using SharePoint + Remember Me Option - Enjoy SharePoint (5)

3. Provide the formula below in the screen’s OnVisible property. It will convert the text in the password field to dots.

Set(lblview,TextMode.Password);

Here, TextMode.Password will hide the actual text with dots for security. Now, it is assigned to the lblview variable with the Set function.

How to Create Login Page in Power Apps Using SharePoint + Remember Me Option - Enjoy SharePoint (6)

4. Now, use that variable in the Mode property of the password text input control.

How to Create Login Page in Power Apps Using SharePoint + Remember Me Option - Enjoy SharePoint (7)

5. Provide the formula below in the OnSelect property of the View Icon. Then, save the changes.

Set(lblview,TextMode.SingleLine)

It will convert the dots in the password field into text.

How to Create Login Page in Power Apps Using SharePoint + Remember Me Option - Enjoy SharePoint (8)

6. Provide the formula below in the OnSelect property of button control.

Set(VarUserID, txt_userID.Text);Set(VarPassword,txt_password.Text);Set(VarUserExist,!IsBlank(LookUp('Event Registration Form',Title = VarUserID )));If( !VarUserExist, Set(varErrorMessage,"User ID not found"), If(LookUp('Event Registration Form',Title = VarUserID ).Password = VarPassword, Set(varErrorMessage,""); Navigate(Event_CompleteDetails_screen), Set(varErrorMessage, "Password is incorrect.") ));

In this code,

  • VarUserID and VarPassword are the variables that contain the text entered in the UserID text input control(txt_userID) and Password text input control(txt_password).
  • The VarUserExist variable holds the LookUp() value. This lookup function checks whether the user ID value is present or not in the SharePoint list.
  • varErrorMessage is the variable used to display the error message if the user ID or Password does not exist.
  • The Title and password are the column names in the Event Registration Form.
  • Event_CompleteDetails_screen is the screen name containing the events’ details in Power Apps.
See also Power BI average function with Examples

The above code will check whether the User ID is in the SharePoint list. If present, it will again check its password. If that password is matched, it will navigate to another screen.

Otherwise, it displays an error message for the password. If the user ID does not exist in SharePoint, it will display an error message.

How to Create Login Page in Power Apps Using SharePoint + Remember Me Option - Enjoy SharePoint (9)

7. Now, add one text label to display the error message. Then, add the variable that contains an error message in the Text property of the label.

Text: varErrorMessage

8. Save the changes and preview the app once. After providing the correct User credentials, it logs to another screen. It displays an error message if we enter the wrong password or a user ID that does not exist.

How to Create Login Page in Power Apps Using SharePoint + Remember Me Option - Enjoy SharePoint (11)

In this way, we can create the login form in Power Apps.

How to Implement Remember Me in Power Apps Login Page

In Power Apps login forms, we can use the Remember Me functionality to auto-fill the passwords for users who log in regularly. This makes the login process quicker and easier.

Look at the example below. After clicking the remember me check box while logging in, the password auto-fills next time.

How to Create Login Page in Power Apps Using SharePoint + Remember Me Option - Enjoy SharePoint (12)

Follow the steps below to achieve this.

1. Add one Check box control to the Power Apps login form. Then, provide the below name in its Text property.

Text : "Remember Me"
How to Create Login Page in Power Apps Using SharePoint + Remember Me Option - Enjoy SharePoint (13)

2. In the OnCheck property of the check box, provide the formula below.

ClearCollect( UserCredentials, { UserID: txt_userID.Text, Password: txt_password.Text })

This formula creates a collection to store the user ID and Password. Here, UserCredentials is the collection name, and txt_userID and txt_password are the text input control names for user ID and password.

How to Create Login Page in Power Apps Using SharePoint + Remember Me Option - Enjoy SharePoint (14)

3. Now, in the OnSelect property of the login button, add the below formula.

If( chk_RememberMe.Value, Set(LocalUserCredentials,UserCredentials),"");

Here, chk_RememberMe is the checkbox control name, and LocalUserCredentials is the variable containing the UserCredentials values.

See also How to call a flow from another flow in Power Automate

So, when this Remember Me checkbox is clicked, the userID and password will be set into the LocalUserCredentials.

How to Create Login Page in Power Apps Using SharePoint + Remember Me Option - Enjoy SharePoint (15)

4. Provide the formula below in the Default property of the password text input control.

LookUp(LocalUserCredentials,UserID=txt_userID.Text,Password)

This will fetch the password and populate it in the password text input control when we type userID.

How to Create Login Page in Power Apps Using SharePoint + Remember Me Option - Enjoy SharePoint (16)

Now, save the changes and preview the app. After clicking the Remember me check box while logging in, the password will populate automatically when you enter the User ID next time.

Moreover, you may like some more Power Apps articles:

  • Update SharePoint List Item Using Power Apps Patch Function
  • Get Selected User Manager Name By Default in Power Apps
  • Link to a Specific Screen in Power Apps
  • PowerApps Play Video From SharePoint
  • How to Use Power Apps DropDown Control
  • Power Apps Delegation Warnings
  • Create Cascading Dropdown in Power Apps

I hope you found this article useful. I have explained how to create a login form in Power Apps using the SharePoint list and how to autofill the password using the Remember me in the Power Apps login form.

You can follow the steps that I have explained above whenever you are trying to create a login form and need to populate the user credentials.

How to Create Login Page in Power Apps Using SharePoint + Remember Me Option - Enjoy SharePoint (17)

Bijay Kumar

After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (9 times). I have also worked in companies like HP, TCS, KPIT, etc.

See also How to get more than 100 items using the Get items action in Power Automate?
How to Create Login Page in Power Apps Using SharePoint + Remember Me Option - Enjoy SharePoint (2024)
Top Articles
Latest Posts
Article information

Author: Ouida Strosin DO

Last Updated:

Views: 6092

Rating: 4.6 / 5 (56 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Ouida Strosin DO

Birthday: 1995-04-27

Address: Suite 927 930 Kilback Radial, Candidaville, TN 87795

Phone: +8561498978366

Job: Legacy Manufacturing Specialist

Hobby: Singing, Mountain biking, Water sports, Water sports, Taxidermy, Polo, Pet

Introduction: My name is Ouida Strosin DO, I am a precious, combative, spotless, modern, spotless, beautiful, precious person who loves writing and wants to share my knowledge and understanding with you.