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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Reset password functio...
Power Apps
Answered

Reset password functionality

(0) ShareShare
ReportReport
Posted on by 986

Hi,
I am trying to implement a reset password functionality in my Sample canvas app for which I am using SharePoint list as data source. In the SharePoint list there are two columns named: title(username) and password. I have created a button on the login screen named Reset button which navigates to Forgot password screen, in which I have used a Edit form with datasource: Sharepoint List (Login List), so I want to change password for the records (w.r.t username: it should be used a reference to change password) that are present in the list not any random record.

So I referred one of the questions on Community: Update Password using SharePoint list (Link: https://powerusers.microsoft.com/t5/Building-Power-Apps/Update-Password-using-SharePoint-list/m-p/680021/highlight/false#M217303) ;
But I was facing one issue that on the screen it displayed 'No Items to display'. So I have replied on the above answer. I am attaching some screenshots of my app for your reference, please let me know if it is correct and how to achieve the change password functionality.

Login Screen:

Sidhant_02_0-1672390073004.png


Login list:

Sidhant_02_1-1672390109716.png


Forgot Password page:

Sidhant_02_2-1672390196401.png


For Title and Password field, Default value set to empty: (Unlocked the data card)

Sidhant_02_3-1672390280180.png


Submit button:

Sidhant_02_4-1672390314451.png

 

(Expected Outcome:
1. User clicks on Reset Password button
2. On Forgot password page enters the username and password (the username should be used for comparing if that record exists, if it does then only the change the password field and update the password field column for that record)
3. After user clicks Submit display message: Password changed (optional) and then navigated to login screen.
)

Screenshot 2022-12-30 142236.png
Categories:
I have the same question (0)
  • KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    Hi @Sidhant_02,

     

    It looks like the form filters 'Login List' on Title and Password but should it filter on Title only as that is the only info that the user knows at this point?

    KeithAtherton_0-1672408292800.png


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Sidhant_02 Profile Picture
    986 on at

    Hi @KeithAtherton ,

    Yes the user knows only the username. So should I remove the second condition as I was referring to another forum question which was quite similar to my requirement in which both the username and password fields were being used.
    Reference link:
    Solved: Update Password using SharePoint list - Power Platform Community (microsoft.com) (See the first response)

  • KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    Ah, I see, thanks for sharing the link to the other forum question.

     

    Yes, exactly; remove the second condition as we only want to match on the user name, like this:

    Title = Textinput1.Text

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Sidhant_02 Profile Picture
    986 on at

    Hi @KeithAtherton ,
    I was able to implement the Reset functionality just had to make some changes in the expression. Instead of using the Edit form I retrieved the user details from the login screen (for that every time I need to type the username on the Login screen) and then navigate to ForgotPassword screen.

    Sidhant_02_0-1673249769643.png

    And OnSelect of the submit I added the following:

    Sidhant_02_1-1673249848696.png

    The password is getting reset, but while testing I observed that even after providing password as blank and on-clicking submit the application was getting navigated to Success screen and did not execute the if part

    Login list (Before setting the password field to blank):

    Sidhant_02_2-1673250009534.png

     

    Sidhant_02_3-1673250059245.png

    In the above image I have left the password field blank and when I clicked on Submit button it navigated to Sucess screen

    Sidhant_02_4-1673250119736.png

    In SharePoint List it displayed:

    Sidhant_02_5-1673250155186.png

    So could you please let me know what is going wrong?

  • KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    Good news that the password reset now works!

     

    Unfortunately I cannot investigate the If logic further as I cannot see what Errors('Login List') contains, which is potentially where the issue is.

     

    However, I would recommend checking if the password is non-blank before the Patch function is called, that way the SharePoint List is kept as accurate as possible.

     

    If you do need to check for errors in Power Apps, the IfError function can be used. More info: https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-iferror


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Sidhant_02 Profile Picture
    986 on at

    Hi @KeithAtherton ,
    I was able to show a notification message if the password field is left blank, but now I wanted to know can I add multiple conditions in a if statement and if it is satisfied then navigate to a error screen (created by me).
    In my case I want to check if there any errors in the SharePoint list already or if the user has left the password filed as blank then the notification should be shown and Navigated to a custom screen. Else the password is reset (if there are no errors in the list or the password input field was filled)

    Sidhant_02_0-1673330916404.png

    The above expression is executed onSelect of Submit button in the Forgot password page:

    Sidhant_02_1-1673330983800.png

    If the user leaves the password field blank then I I have used IsBlank which is working. What I want is if there is any issue in the list or field is blank then the Incorrect Password screen must be shown (which I have created):

    Sidhant_02_2-1673331130244.png

    Otherwise if everything is fine then the confirmation screen must be shown:

    Sidhant_02_3-1673331170547.png


    So I did try to put the Navigate option in the if-block and outside the second condition, this kept executing the error message block even if I have entered the password field and should show confirmation screen not incorrect password screen

    Sidhant_02_0-1673333361413.png

     

     

    Sidhant_02_1-1673333405921.png

     



    What changes do I need to make?

  • KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    It looks like the "|| IsBlank(TextInput3)" line may be causing an issue, and the order of the logic will likely cause issues as it's attempting to patch the record before checking if the password field is blank.

     

    I'd suggest breaking the logic down and re-writing the code. For example, in pseudo code:

    If password field is blank, notify user then stop processing.
    Patch list record, notify user if successful.
    If list contains errors, notify user and navigate to Incorrect Password screen.

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Sidhant_02 Profile Picture
    986 on at

    Hi @KeithAtherton ,
    I did try to implement the pseudocode which you mentioned but did not understand how to stop the process and in power apps do we have else if and else. This is what I understood:

    Sidhant_02_0-1673354711804.png

    If possible could you give the correct expression as per your pseudocode

  • KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    A few comments on the code in the screenshot:

    • Patch function call needs a couple of closing brackets before the Navigate function is called.
    • The last Notify function call needs a closing bracket.
    • Hover over the red underlines to get error details to help you resolve the issues.

     

    A useful way of stopping processing is to do similar to the following:

    UpdateContext({locIsValid:<Your boolean logic>});
    
    If(locIsValid,
     <Your actions>
    );

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Sidhant_02 Profile Picture
    986 on at

    Hi @KeithAtherton ,

    Thanks for the comments on my response, I have made few changes to the expression, which is:

    Sidhant_02_1-1673356426031.png

     

    Is it correct?, any changes that need to be made in it.
    Because after leaving the field as blank I am getting the error message but its navigated to the Confirmation screen instead I want the user to be on the same password Reset screen and after they fill in the field they should be navigated to other screen:

    Sidhant_02_2-1673356590748.png

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 846

#2
Valantis Profile Picture

Valantis 532

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard