Tuesday, June 19, 2018

Approvals for Dynamics 365 using Microsoft Flow


One of the business requirement which I have encountered is to provide an ability to approve or reject a request (for example lead or Opportunity) in an email without having to open Dynamics 365.
This is now possible using Approvals in Microsoft Flow. Below is an example.
Business scenario – When a lead is created in Dynamics 365, send an Approval email to user/s. Provide some details of the lead in the email. Once the user approves or rejects the lead, capture the response with the comments in Dynamics 365.
   
        I have setup the following environments –
a.       Dynamics 365
b.       Microsoft Flow
c.       Outlook online - Office 365

     Create a new Approval flow with Dynamics 365. In this example an approval email is sent when a Lead is created. I have connected to the demo org and selected the Lead entity.
Flow trigger - When a lead is created

Next step is to create the Approval.  The approval sends an email to the approver with a link to the record and some details info. The approver can review the email, approve or reject the record from within the email and add comments to it.

Approval email config
When a Lead is created in Dynamics 365 the approval is triggered and it sends an email to the person/s who need to approve. The email is shown below. The email is from Microsoft. I am not sure if this can be modified. The body of the email is as configured and shown below

email body
The approver can select Approve or Reject from within the email and also add comments.
The next step is to set a condition for updating the response into Dynamics 365. I have added the condition below. I have also added 2 custom fields to the Lead entity to store the response in the Lead record.

Conditional action
If approved I want the Lead record to be updated with the response and comments.

Update lead

I can also add a condition if the Approver rejects to update the lead with the response and comments.
Here is the end result with the Lead entity record updated in Dynamics 365.

Lead record updated
Microsoft has provided ability to track the run history and performance of the flow with Power BI analytics.


Run performance

This is a simple way to perform Approvals in Dynamics 365 using Microsoft Flow. I hope this helps you to try the Approvals and let me know your experience with it.