Quantcast
Channel: Dynamics Communities
Viewing all articles
Browse latest Browse all 966

How to Implement a Quote Approval Process for Dynamics 365 CRM Using Power Automate

$
0
0

In this post, I want to walk you through how to build an approval flow in Power Automate for Dynamics 365 Sales users.

Imagine the following business scenario:

Today, your sales reps generated Opportunities and Quotes in Dynamics 365 Sales. If a Quote is above $50,000, the sales rep must get approval on the Quote from a Sales Manager before they can send the Quote to the customer. Today, this is done manually via email. You, as the System Administrator, are going to automate this process for the team using Power Automate and the Approval connector.

This is the final Power Automate flow we will build:

A screenshot of a computer

Description automatically generated

Configure the Trigger

We are going to use a Dataverse trigger When a row is added, modified or deleted. You will configure the following:

  • Change type: Modified
  • Table name: Quotes
  • Scope: Organization

We want to ensure that this flow is only triggered when the following criteria are met:

  • Quote status is Active
  • Total Amount is $50,000+

To do this, you need to click the Show Advanced Options link in the trigger box. Then, you can add the following:

  • Select columns: statecode, otalamount
    (This ensure that the flow is only triggered when a value for one of these fields has changed.)
  • Filter rows: totalamount gt 49999 and statecode eq 1
    (The flow will only run when a Quote has total amount greater than $49,999 AND the status is Active.)

HINT: Use the FetchXML Builder from Jonas Rapp (thanks Jonas!!) from the XrmToolBox to get your data expressions to select columns and filter rows!

Your trigger should look like this:

A screenshot of a computer

Description automatically generated

Add an Action: Get a Row by ID

This step is here because we will need to use the Sales rep’s email address in our final steps. In order to do that, we need to get the details of the Owner of the Quote record. This one is quite simple to configure. In your action step, select Get a row by ID using the Dataverse connector. Configure the following:

  • Table name: Users
  • Row ID: Use dynamic content to get the Owner (Value) from the trigger

It should look like this once complete:

A screenshot of a computer

Description automatically generated

Add an Action: Get a Row by ID

We need one more Get a row by ID action with the Dataverse connector: this time to get the Account details. Configure the following:

  • Table name: Accounts
  • Row ID: Use dynamic content to get the Potential Customer (Value) from the trigger

It should look like this once complete:

A screenshot of a computer

Description automatically generated

Add an Action: Start and Wait for an Approval

Then, we will add our first action. Search for the Approval connector, then select Start and wait for an approval.

A screenshot of a computer

Description automatically generated

Note: you may need to create a connection to the Approvals connector if this is your first time using it.

You can select from five options for your approval type:

  • Approve/Reject – Everyone must approve
  • Approve/Reject – First to respond
  • Custom Responses – Wait for all responses
  • Custom Responses – Wait for one response
  • Enter custom value

In this scenario, we can select Approve/Reject – First to respond. Depending on your specific use cases, another option may be preferred.

Next, configure the additional properties of the Approval action. Use Dynamic content from your trigger step to personalize the approval message. It may look like this once you are complete (but obviously, select the appropriate Assigned to email addresses!):

A screenshot of a computer

Description automatically generated

Add an Action: Condition

Next, we will add an action for the Condition using the built-in Control connector. This will let us have a YES path, and a NO path.

We want our condition to be set to the Outcome (from the Approval step) is equal to Approve.

A screenshot of a computer

Description automatically generated

Yes Path: Send an email (V2)

Next, in the Yes path, select the Send an email (V2) using the Office 365 Outlook connector. Configure the following:

  • To: use Add dynamic content to get the email address from the Get a row by ID step above.
  • Subject: Add dynamic content here to make it customized.
  • Body: Add dynamic content here to make it customized.

If may look similar to this when you are complete:

A screenshot of a computer

Description automatically generated

Note: the Apply to Each was automatically added once I pulled in dynamic content for responses. This will happen to you as well if you add that information to your action step.

No Path: Send an email (V2)

Once again, we will select the Send an email (V2) using the Office 365 Outlook connector. Configure the following:

  • To: use Add dynamic content to get the email address from the Get a row by ID step above.
  • Subject: Add dynamic content here to make it customized.
  • Body: Add dynamic content here to make it customized.

If may look similar to this when you are complete:

A screenshot of a computer

Description automatically generated

Note: the Apply to Each was automatically added once I pulled in dynamic content for responses. This will happen to you as well if you add that information to your action step.

Test, then Publish!

Make sure to test your flow, then publish it and voila – you have automated this once manual Quote approval process for your sales reps and managers!


The post How to Implement a Quote Approval Process for Dynamics 365 CRM Using Power Automate appeared first on Dynamics Communities.


Viewing all articles
Browse latest Browse all 966

Trending Articles