Parallel Approvals – Power Automate and Dynamics 365


Let us update our previous flow to include parallel approvals.

Check other posts on Approvals – https://nishantrana.me/2020/08/31/approvals-power-automate-dynamics-365/

The difference between Approve / Reject Type – Everyone must approve and parallel approvals would be that using parallel approvals we could wait for responses for all the approvers, be it approve or reject.

In case of Everyone must approve, if any of the approvers rejects, the request is considered rejected and it will not wait for other approver’s response, and for the request to be considered approved all the approver needs to approve it.

Let us add a new action Add a parallel branch after Apply to each.

Let us keep only test user 1 in the first branch and in the other branch add a Start and wait for an approval action.

We have updated both to be approval type First to respond, set Assigned to the property to test user 1 and test user 2 for the respective branches.

And also we want to evaluate the responses from both the approvers before taking further action, so we have deleted the condition action from the first branch.

Let us add a new Condition action, with 2 AND conditions, i.e. if the first user approves and the second user rejects which corresponds to the respective Start and wait for an approval action.

Here if the condition is fulfilled we update the description of the case record.

Let us save, check, and trigger the flow.

After test user 1 has approved, we can still see the flow waiting for user 2 to respond.

The flow completes successfully after the response is received from both the approvers. Here user 2 rejects the request.

As expected, we can see the description field updated as defined in the update the record action.

Hope it helps..

Attachments in Approval – Power Automate and Dynamics 365


Let us update our previous sequential flow, to include file attachments to notes of the case record, as part of the approval.

Check other posts on Approvals – https://nishantrana.me/2020/08/31/approvals-power-automate-dynamics-365/

First, we need to add Initialize variable action and define an Array variable to store all the attachments details.

Next, we will use List records action, to fetch all the notes records associated with that particular case record.

Next, we will use Apply to each action to loop through all the attachments and use it to populate our attachments array variable defined in the previous step.

Now as the last step, we’d specify the attachment array variable for the attachment field inside the Start and wait for an approval action.

Now we are ready to save and test our flow.

Here our flow is waiting for approval from the user.

The approver receives the notification and can now review the attachments before responding.

Hope it helps..

Advertisements

How to – Use Approval/Reject Type – Everyone must approve – Power Automate and Dynamics 365


Let us update our previous flow from approval/reject typeFirst to respond to Everyone must approve type.

Check other posts on Approvals – https://nishantrana.me/2020/08/31/approvals-power-automate-dynamics-365/

For First to respond, either Approval or rejection by any of the approver completes the request.

In case of Everyone must approve, if any of the approvers rejects the request is considered rejected, for the request to be considered approved all the approver needs to approve it.

We have updated the approval type from first to respond to

everyone must approve.

In the case of Approve / Reject – Everyone must approve

  • All the assigned users must approve, for the request to be approved.
  • Any of the assigned users if rejects, the request will be considered rejected.

Let us run the flow and test it.

We can see our flow waiting for approvals

We can see all the 3 approvers getting the approval request

Let us Reject it for one of the approvers.

It completes the flow without waiting for responses from other approvers.

The other approvers will see the below message.

Similarly, as expected, it will wait for all the approvers to approve before moving to the next action.

We need to make sure we specify the same value as shown in the Outputs above in the condition action.

Hope it helps..

Advertisements

Manager approval – Power Automate and Dynamics 365


Continuing our previous basic  approval flow, here we’d update it to send an approval request to the manager of the user.

Check other posts on Approvals – https://nishantrana.me/2020/08/31/approvals-power-automate-dynamics-365/

First, we’d use the Get manager V2 action to get the user’s manager.

Let us first update the profiles of the users to add their manager.

Sign in to the Azure portal as an administrator and select Users inside Azure Active Directory.

Here we have specified test user 2 as manager of user 1.

Let us now update our flow, add a Get a record action to get the email of the owner of the case record which will be used later to get the user’s manager.

Here in Item Id, we are passing Owner, it could well be created by or modified by as well.

In the select query, we are specifying the internal email address i.e. primary email address of the user.

Now for the If Yes step, we have used the Get manager action, and have specified the primary email address fetched earlier.

The Mail returned by the Get manager action is used for Assigned to field inside Start and wait for an approval action.

Based on the outcome of approval we are then updating the case record.

This is how the flow looks like

On running the flow, we can see the user’s manager email address in the output for the Get manager V2 action.

We can see the manager of the user 1 getting the approval request.

Now instead of the manager specified in User’s profile in Office 365 (Azure AD), let us update the flow to send an approval request to the User’s manager (system user) inside Dynamics 365.

Let us update the flow,

in the Get a record action instead of fetching the primary email address (internal email address) of the owner, we’d use Expand Query to fetch the primary email address of the Manager specified in the Owner (system user) record.

Create the query with link entity in our favorite FetchXML Builder and click on Power Automate Parameters

Copy the Expand query.

Paste it in the Expand Query of the Get a record action.

Remove Get manager (V2) 2 action from If Yes step, as we already have the email address of the manager now and specify the same in the Start and wait for an approval action’s Assigned to field.

Save and Test the flow.

Here we can see the test user 2 who is the manager of user 1 receiving the approval request.

We can the manager’s email in the output for Start and wait for an
approval action.

Thus, we see a couple of ways to implement Manger’s approval, we’d look at a few more scenarios in the next posts.

Do check out the wonderful training on Approvals in Power Automate

https://www.linkedin.com/learning/microsoft-flow-approval-flows/

Hope it helps..

Advertisements

CDS List Records Filter Query using Flow


Thomas Sandsør's avatarCRM Keeper

This week I needed to use the List Records function, and I realized that I had no idea how to use the filters. Thank you Jonas Rapp for creating the FetchXML Builder!! The function “Flow List parameters” saved my day:)

Simple filters

Let’s begin with the simple filters where I get a contact with the last name of Sandsør

Test your search result with the Execute button so see that anything is actually returned. Then open the Flow List Parameters

The tool converts the Fetch XML, and magically gives the correct filter to add in our FLOW query. It can’t get much simpler than that!!

Lookups

Lookups act a little bit different with the syntax, as lookups always to. This got me quite confused before finding this tool, because I was not getting match to my result.

I am searching for contacts with a given GUID. In my case I…

View original post 186 more words

Call Azure Function from Dynamics 365 CRM using Webhooks


Interesting read !

priyeshwagh777's avatarD365 Demystified

This is a vast topic to cover in a blog. But I wanted to write from a bird-eye’s view of how this will pan out in an implementation where you perform a certain operation in Dynamics 365 CRM and an Azure Function is called to perform further operations.

This post is written keeping in mind fair knowledge of Azure Functions, Storage accounts and subscriptions in mind.

I’ll try to keep the article short, so stay with me! 🙂

Create a Function App in Azure

  1. Let’s say you have created a Function App in Azure already and want to connect to Dynamics 365 CRM. Click on the big + New Function button in the screenshot below
    resourceOverview_LI
  2. Now, since I want to keep Visual Studio as my driver for coding and deployment, I’ll create a new Project in Visual Studio of type Azure Functions and click Next
    newProj
  3. On the next page, I’ll…

View original post 560 more words

Nishant Rana's Weblog

Everything related to Microsoft .NET Technology

Skip to content ↓