There are several ways to formulate a Dynamics 365 record URL and make it clickable in a Flow in Power Automate.
Here’s one of the ways I follow for most scenarios – Let’s say I want to open a PSA Time Entry record from my Flow, here’s how I do it
Get record action to retrieve URL
Since this post is focused on CDS connector, I can get the D365 record link in body of Get record action for Common Data Service connector.
Unfortunately, I didn’t see this if the trigger was a CDS action, so I made a separate Get record call.
But, we’ll retrieve the same without having to select/parse body object. So let’s see –
Generating Link
First, I’ve initialized a variable that’ll hold the String format of the end URL
Now, first – I’ve appended https://. This won’t come directly using the uriHost() method
Then, the uriHost() holds the formula ‘uriHost(body(‘Get_record’)?[‘@odata.id’])‘
Meaning, get the uriHost name i.e. Environment name itself.
Then, I’ve appended options for the window to open which are mentioned below in this post.
Finally, I’ve appended the Primary Key of the record itself at the end
Options
Now, let’s talk about the options –
- cmdBar = [true | false]
It’ll show the ribbon on the record. If false is chosen, it’ll be hidden - navBar = [off | on]
It’ll show the Navigation Bar on top if on. If off, it’ll be hidden - newWindow=[true | false]
This didn’t affect in my case. It anyway opened in a new tab. This could be different is the link is not opened from Email but is used elsewhere - pagetype=entityrecord
Since we are targeting a Dynamics 365 entity record, the above is used. - etn= [name of the entity]
Name of the entity - id
GUID of the record itself.
Here’s an Email that I composed to show how the URL will end up looking –
Which will result in Email like this
And open the record like this.
As per my settings in the URL I created, I don’t have the Nav Bar or Command Bar visible. It’s up to you to decide your preference
Here are some more Power Automate / Flow content you might want to check –
- Text Functions in a Flow | Power Automate
- Loop through array of objects in a Flow & Create records in CDS | Power Automate
- Get Count of records retrieved in CDS connector in a Flow | Power Automate
- Number Formatting in a Flow | Power Automate
- Call a Dynamics 365 Action from Flow [Bound and Unbound Actions] | Power Automate
- Make HTTP request from Flow in Power Automate
- Switch-Case in a Flow | Power Automate
- Setting Retry Policy for an HTTP request in a Flow | Power Automate
Hope this helps!!
[…] Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate […]
LikeLike
Hi, is there a way to include the link in the email body so that when user clicks on it, it opens the crm record within the CRM mobile app (not in the mobile browser)?
LikeLike
Hi Bify, I haven’t tried this yet. Once I try I’ll let you know if it does open. At this point, I’m not too sure.
LikeLike
Thank you, it worked!
LikeLike
Thanks!! Glad it helped.
LikeLike