By Razia Usman

Password Reset Automation for Account and Contact on same Email in Power Pages

Introduction

In today’s digital landscape, where security and user experience are paramount, optimizing password reset processes is critical. This blog post offers a comprehensive guide to refining password reset mechanisms for accounts and contacts that share the same email address. By leveraging Dataverse and Power Automate, you can streamline these processes while maintaining stringent security standards.

Step 1: Adjusting the Existing Process

1.1 Forgot Password Feature:

The portal has a password reset feature allowing Contacts to reset forgotten passwords. It’s powered by a process generating a unique link sent via email. Originally, emails are sent from the Contact owner, but many organizations opt for services like SendGrid or specific mailboxes instead. This post explores integrating the link generation process with Power Automate for email delivery.

forgot password
Forget Password Feature

1.2 Disable the Process:

First, find the “Send Password Reset To Contact” process in Dataverse. Disable it for editing, then remove the existing email step to prevent email dispatch. Reactivate the process to retain its action of generating the CallbackURL for password reset, ensuring functionality without email transmission.

Disable the Process

1.3 Customize Email Step:

Within the process, identify and remove the email step responsible for sending password reset instructions.After customization, reactivate the process to preserve other functionalities, such as generating the CallbackURL.

email
Customize Email Step

Step 2: Creating a Power Automate Flow

2.1 Design the Flow:

Access Power Automate and initiate the creation of a new flow.

Design the Flow

2.2 Configure Trigger:

Select the Dataverse connector and choose the “When an action is performed” trigger, specifying relevant parameters.

Configure Trigger

2.3 Filter Contacts:

Add the “List rows” action to filter contacts based on the provided email address, ensuring targeted processing.

Filter Contacts

2.4 Implement Child Flow:

Integrate a child flow for each filtered contact, managing password generation and email dispatch efficiently.

Implement Child Flow

Step 3: Implementing the Child Flow

Implement Child Flow

3.1 Define Parameters:

Within the child flow, parameters serve as inputs that enable the flow to dynamically process data and perform actions. Define the following essential parameters:

  • Contact GUID: This unique identifier is crucial for pinpointing the specific contact associated with the password reset request.
  • Account Email: The email address linked to the user’s account, facilitating communication and identification.
  • Account Type: A parameter indicating whether the password reset request pertains to an account or a contact, guiding subsequent actions.
  • Send forget password: A trigger or action that signals the initiation of the password reset process, serving as a catalyst for flow execution.

define parameters

3.2 Variable Initialization:

Variables play a pivotal role in storing and manipulating data within the child flow. Initialize the following variables to facilitate password generation, email composition, and communication:

  • Password Variable: Create a variable to store the randomly generated password, ensuring secure and unique credentials for each user.
  • Email Content Variable: Establish a variable to store the content of the password reset email, including the username and newly generated password.
  • Email Subject Variable: Define a variable to store the subject line of the password reset email, ensuring clarity and professionalism in communication.
variable initialization

3.3 Retrieve Contact GUID:

Utilize actions within the child flow to fetch the GUID (Globally Unique Identifier) of the contact associated with the password reset request. This step ensures precise identification of the user requesting the password reset, facilitating targeted actions and communication.

Retrieve Contact GUID

3.4 Generate Password:

Implement functions or methods to generate a random password securely within the child flow. Assign the generated password to the designated variable, ensuring that each user receives a unique and robust password for account access.

Generate Password

3.5 Conditional Logic:

Apply conditional statements within the child flow to differentiate between password reset requests for accounts and contacts. This logic enables the flow to execute appropriate actions based on the account type, ensuring accurate password updates and email dispatches:

Conditional Logic
  • Check Account Type: Evaluate whether the password reset request pertains to an account or a contact, guiding subsequent actions.
account type
Account Type
  • Update Password For Account: If the request involves an account, update the password for the associated account entity.
Update Password for Account
Update Password for Account
Update Password for Account
  • Send Email: Compose and dispatch emails containing the username and newly generated password to users, providing them with the necessary information to regain access to their accounts securely.
Send Email
Send Email
  • Update Password For Contact: For contact requests, update the password for the contact entity.
Update Password For Contact
Update Password For Contact
  • Send Email: Compose and dispatch emails containing the username and newly generated password to users, providing them with the necessary information to regain access to their accounts securely.
Send Email
Send Email

Conclusion

By following these detailed steps, you can enhance the password reset process for both accounts and contacts sharing the same email address. Utilizing Power Automate and Dataverse allows for automation and customization, resulting in a more efficient and user-friendly experience. With these improvements in place, you can ensure that password resets are handled securely and promptly, minimizing disruption for users.

Featured Insights

Stay Informed with ITKnocks'
Latest Technical Articles

Let's Shape the Future Together!

Ready to shape the future of your business? Connect with ITKnocks, your catalyst for innovation. Let’s collaborate and transform possibilities into reality. Contact us, and let the possibilities unfold!