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

Approvals in Power Automate and Dynamics 365


Let us try implementing a basic scenario, where an agent can send a case for approval and the record is updated based on the approver’s response.

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

The agent here sets the Submit for Approval – custom field as Yes and saves the record for submitting it for approval.

The description field will be updated to reflect approval or rejection.

Login to Power Automate

https://flow.microsoft.com/

Start with Automated Flow (blank template)

Choose trigger as When a record is updated. (Common Data Service)

Select the appropriate environment, cases as entity name, and scope, for attribute filter, we have selected the custom field ‘submit for approval’

Add a new step and search for Approvals action.

Select approval type as Start and wait for an approval and specify the appropriate values.

To Item link with the URL of the case record

https://nishantrana.me/2020/08/25/add-url-of-record-in-item-link-in-approval-power-automate-dynamics-365/

Save the flow and add a Condition step with the condition ‘Outcome’ equal to ‘Approve’.

For If Yes step, select Update a record (Common data service) action, specify values for Entity name, Item ID, and Description field.

Repeat the same for the If no step.

Update – add the condition to check the value of submit for approval field

IfCondition

As we will request for approval only if value is true.

Let us select the Flow checker to check the flow first before we can test it.

As there are no errors or warnings, click on the Test button and select the I’ll perform the trigger action option.

To trigger it, open a case record, set Submit for approval field as Yes, and save it.

We’d see our flow running and waiting for the approval.

The approver can either approve it through email.

Or within the mobile app.

https://aka.ms/flowmobilediscoverabilitybanner

As well as the approval center.

Let us approve the request.

We’d see our flow completed successfully.

And the case record updated.

This was the very basic example to begin with, in the next few posts we’d try covering other scenarios.

Hope it helps..

Advertisements