Loading...

How to get dynamic Record URL in Power Automate (quick tip)

How to get dynamic Record URL in Power Automate (quick tip)
How to get dynamic Record URL in Power Automate (quick tip) David Uhlmann Sun, 07/10/2022 - 13:03
Body

How to get dynamic Record URL in Power Automate

There seems to be some amount of confusion on the web about how to use Power Automate to get the dynamic record URL of a record in Dynamics CE.

Power Automate comes with a few onboard tools. To understand what we are talking about here. A typical Dynamics CE URL, here for an opportunity record, might look like this:

How to get dynamic Record URL in Power Automate

If you want to create this URL inside a Power Automate flow, for example, to put it inside an approval e-mail you need to think about how to do it.

For example, you can parse the JSON output of an action to get the URL of the Dynamics instance:

How to get dynamic Record URL in Power Automate

The body part contains many technical details that are exchanged inside the flow while it is running. Among them is also a URL. This output can later be used with an expression like uriHost(body('GetOpportunity')?['@odata.id']) can be parsed. From this you will get the following URL:

https://org18eb47a1.crm4.dynamics.com/. However, what is still missing is the App ID and the GUID of the record to assemble the link. 

If you search the net on how to assemble this link dynamically you will find a few sources that follow two approaches. The first approach tries to determine all important components (Dynmics URL, App-ID, and GUID) with flow board means, while the second approach relies fully on JavaScript. However, both approaches have a fundamental disadvantage. They (often) assume that the components of the link that are between those "core" elements do not change. Likewise, these solutions are valid but still somewhat of a "tinker". 

So our goal is something like this:

How to get dynamic Record URL in Power Automate

Well, there is a simple trick to get to this link. This one uses good old Dynamics CE onboard tools. What to do here, at least that would be my suggestion, is:

1.) Create a new field (I called it "RecordURL").

2.) Set up a "Real-Time" workflow on the corresponding entity (Important NOT run workflow in the background - It has to be the real-time one!)

3) Whenever changes are made to the record (for example, when saving), the dynamic URL is written into this field.

4) Using this field in Power Automate

How to get dynamic Record URL in Power Automate

We can now use this field in our Approval Flow. Whenever an approval email is being sent, the person will receive a direct link to the record:

How to get dynamic Record URL in Power Automate

This screenshot also shows that these days you can forget about hyperlink formatting, as this is done by the tool for you. So let's check if this one works out:

How to get dynamic Record URL in Power Automate

Because Sales is probably the most obvious case for approval processes, I have created a simple approval process as an example here.

This checks if the amount is above 3 million USD and if the approval status is not "Yes". After the user hits save the flow is triggered and contains the URL to the record:

appr email

When I click on the link I get directly to the record. And this is more or less it. If you have trouble building this do not hesitate to reach out to me. p.s: sometimes it is a good idea to check the "good old" onboard things :-)

How to get dynamic Record URL in Power Automate

Image
/sites/default/files/2022-07/trick2.png

Published on:

Learn more
Featured Articles | Dynamics Chronicles
Featured Articles | Dynamics Chronicles

Welcome to our blog, the content is entirely dedicated to Microsoft Dynamics 365, CRM, Power Platform, Common Data Service (CDS) but also Azure. Follow us !

Share post:

Related posts

HTTP vs Send an HTTP Request in Power Automate

HTTP vs Send an HTTP Request in Power Automate One of my favourite actions in Power Automate is the HTTP action. However it is premium, while...

10 hours ago

Power Automate – Copilot in Power Automate for desktop

We are announcing the Copilot in Power Automate for desktop feature. This feature integrates Copilot into Power Automate for desktop, giving u...

2 days ago

Dynamics 365 Business Central: Can we start Power Automate flow via AL? Yes, but……

Hi, Readers.Today I would like to talk about a question I was asked recently, can we start Power Automate flow via AL? Power Automate empowers...

3 days ago

List, Filter and Delete Flows in Power Automate

A simple little flow that can be used to list and filter flows, to do whatever you wish, and in the example of the dreaded CXP_ gremlin spawn...

3 days ago

Power Automate Flow To Host A Web Page/Web Application

Power Automate can be used to display a web-page or even a single-page web application ... The post Power Automate Flow To Host A Web Page/Web...

4 days ago

Power Automate – Transform scripting using AI driven natural language

We are introducing AI-powered natural language scripting for Power Automate, which simplifies the process of generating code. This feature wil...

6 days ago

Power Automate – Connect your own virtual network with hosted machine group

We are announcing the connect your own virtual network with hosted machine group feature for Power Automate for Desktop. This feature will ena...

6 days ago

Power Automate – Updated Browse Connectors/Actions pane in Cloud flows

The updated Browse Connectors/Actions pane in Cloud flows designer for Power Automate is being released. This update will allow users to searc...

6 days ago

Power Automate – Use Copilot to analyze automation activity

We are announcing the use Copilot to analyze automation activity feature for Power Automate. This feature will allows users to use natural lan...

6 days ago

Power Automate – Streamline workflow creation with the next best action

We are announcing the streamline workflow creation with the next best action feature for Power Automate for desktop. This feature will provide...

6 days ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy