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:
Login list:
Forgot Password page:
For Title and Password field, Default value set to empty: (Unlocked the data card)
Submit button:
(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.
)
Thanks @KeithAtherton, for the detailed replies it did help. I will test it for some scenarios
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.
Hi @KeithAtherton ,
Is this correct:
It worked, thanks for the help @KeithAtherton 😇
So now if I try to leave the field blank it directly notifies me that you cannot leave the field as blank.
Regards,
Sidhant.
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:
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Hi @KeithAtherton ,
Thanks for the comments on my response, I have made few changes to the expression, which is:
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:
A few comments on the code in the screenshot:
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.
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:
If possible could you give the correct expression as per your pseudocode
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.
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)
The above expression is executed onSelect of Submit button in the Forgot password page:
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):
Otherwise if everything is fine then the confirmation screen must be shown:
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
What changes do I need to make?
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.
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
mmbr1606
275
Super User 2025 Season 1