Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Building 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.
)

Categories:
  • Sidhant_02 Profile Picture
    986 on at
    Re: Reset password functionality

    Thanks @KeithAtherton, for the detailed replies it did help. I will test it for some scenarios

  • KeithAtherton Profile Picture
    3,690 Most Valuable Professional on at
    Re: Reset password functionality

    Yes, that's what I'd expect to see, well done.

    I'd recommend thorough testing to ensure it works as expected.


    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
    Re: Reset password functionality

    Hi @KeithAtherton ,
    Is this correct:

    Sidhant_02_0-1673436291638.png

    It worked, thanks for the help @KeithAtherton 😇

    Sidhant_02_0-1673436863272.png

    So now if I try to leave the field blank it directly notifies me that you cannot leave the field as blank.

    Regards,
    Sidhant.

  • Verified answer
    KeithAtherton Profile Picture
    3,690 Most Valuable Professional on at
    Re: Reset password functionality

    My pleasure. The new code is looking good!

     

    To prevent the Patch, Navigate, etc running if the password input is left blank, I would move all of the code highlighted in orange below into the else part part of the "If(locIsValid," statement:

     

    KeithAtherton_1-1673360988809.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
    Re: Reset password functionality

    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

     

  • KeithAtherton Profile Picture
    3,690 Most Valuable Professional on at
    Re: Reset password functionality

    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
    Re: Reset password functionality

    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,690 Most Valuable Professional on at
    Re: Reset password functionality

    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
    Re: Reset password functionality

    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,690 Most Valuable Professional on at
    Re: Reset password functionality

    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.

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

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!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1