Categories: Portals

Back at the start of 2019, I wrote a blog about how to set up and use the Forgotten Password Functionality for portals (Power Pages). Functionality exists for a portal that gives a Contact the ability to do a password reset when they have forgotten their password. This exists as a process (old school workflow) that’s an action which generates a unique link for the Contact and then sends it to them in an email. By default it sends it from the owner of the Contact. Although it can be customised, more organisations are using other services such as SendGrid to send out emails, or even just Outlook but setting a specific mailbox as the from address. This post looks at how you can use the action that runs to generate the unique link, but pass it through in to an email using Power Automate.

Click to view in detail

First, find the process in Dataverse called Send Password Reset To Contact. Disable it so you can edit it, then select the email step that exists. Delete it. We don’t want to have the email sent from here. Now activate the process again. We still need the action to occur and generate the CallbackURL which is the unique link to send to the contact.

Click to view in detail

Now to create what is perhaps the simplest flow in Power Automate I have ever created. It’s just two steps, the trigger when the request is made by someone on the website, and one action to send out an email.

Click to view in detail

The trigger is from the Dataverse connector and is When an action is performed. Set the Catalog and Category to (ALL), and the table name to Contact. Then from the list of actions select adx_SendPasswordResetToContact. This means the flow will begin when someone submits their email on the forgotten password page of the portal.

Click to view in detail

The action can use connectors from SendGrid, Outlook or whatever you want to use to actually send the email. What we now find are values passed through from the action. So for the To field, we can use the Email address we find in the list of dynamic content.

Click to view in detail

Add a subject, and then you can add the body for the email. Might be easier to add the text you want first, but then click on the tag icon to display the HTML code for the email.

Click to view in detail

This is where we can add in a pretty link by using an ahref tag like you see below for the Reset Password section. We want the CallbackUrl value that is passed from the action. I just used the standard out of the box email content, but you can put whatever you want. Finally, at the bottom I used an img src tag to display an image.

Click to view in detail

You can now save the flow and make sure it’s turned on. Then go ahead and test it! Here is the email received. Quick and simple, and so flexible in terms of having control of what is used to send the email. No authenticating of mailboxes and fiddling around with the process. Job done!

Click to view in detail

Check out the latest post:
Trigger Journey After Topic Is Opted In To

This is just 1 of 459 articles. You can browse through all of them by going to the main blog page, or navigate through different categories to find more content you are interested in. You can also subscribe and get new blog posts emailed to you directly.

6 thoughts on “Send Password Reset To Contact Using Power Automate

  1. Megan,
    Thanks for this! I found that if I disable the “Send Password Reset To Contact” the “When Action Is Performed” action gives me the error: “Request to XRM API failed with error: ” when I try to save the flow. I re-activated it and the flow works. It took me a little while to figure out what was going on. Not sure if there was a change in the system since you wrote this or our set up is somehow different.

    Thanks again,

    1. Hi Tim, you definitely need the original Send Password Reset To Contact enabled. The step in the post states to disable so you can edit it, and then activate it again after editing. Unless I’ve misunderstood your comment!

  2. This is brilliant. The only issue I have is that when I click the password reset link, and reset the password, I get an error message saying Invalid Token? Have you come across this before?

    1. Hi Chris, did you reactivate the original workflow after removing the email step from it?

Leave a Reply

Your email address will not be published. Required fields are marked *