
Last week, I finally managed to get my hands on the illusive Relate Record Action to update my “Send ClickDimensions Emails within a Flow” post. However, I found that while the action appeared simple from the outset, actually implementing it was a little more difficult than I had originally expected, especially as I am not that much of a developer. I learned a lot from this simple action and I wanted to share!
First off, it is very important to note that this action is only available for Flows that are built within a Solution! So if you want to use this action, go ahead and create your solution by going to https://make.powerapps.com/. We’ll walk through this below.

After you’ve created your new solution, you can add a nice new Flow in here:

Once you have created your Flow and you’re ready to use the associate records action, you’ll find it under the CDS (Current Environment) actions:

Once you’ve got the right source selected, you’ll now have access to an extended list of actions, including the Relate Records action.

Now we can get to the good stuff! I want to associate a Contact to my Email Send record so that I can send the email to the Contact! So I will first specify which entity I am going to start the association with, which in my case is the Contact.

Once we have specified the Entity Type, we need to tell Flow which contact we’re associating to the Email. In my case it’s being pulled from an earlier action so I’m going to use Flow’s built in Dynamic Content. You could always associate a Marketing List/ Account or Lead to the send also.
Next we are going to specify which relationship to apply to the association. In this case, there is a very convenient drop down that shows what relationships apply to the Contact.

To get a look at what relationships exist for the Email Send, we can see these within the solution itself. From here we can do a little reverse engineering.

The final piece to this puzzle is what really stomped me for many days – the URL field. After much trial and error and with a lot of assistance from the Community, I managed to work it out! Yay! The URL required here is the Web API request for the Email Send record you are creating a relationship with. If you’d like to read a little bit more about this, you can check the documentation out here! To keep it pretty simple, the request URL for a specific record looks like this: [Environment URL]/api/data/v9.0/[Entity Schema Name]([GUID for the record you’re looking for]). So because I was looking for the URL of an Email Send my flow created above, I was able to use the following URL

There you have it! The Relate Records action demystified!
I want to thank everyone from the Power Platform Community for helping me troubleshoot this and a special thank you to Matt Beard for taking the time to teach me about Web APIs today! Community is everything!
Thanks for this, the URL bit really isn’t especially helpfully described anywhere else. It’s especially unhelpful as the only place that this exist is in the “Current Environment” area of the connections, yet hardcoding a URL to the flow actually removes the benefit of using “Current Environment” as you then can’t port it between environments!
LikeLike
You can use the ‘Odata Id’ from the dynamic content of the record you are trying to link, instead of hardcoding the environment URL:
https://flow.microsoft.com/en-us/blog/work-better-with-the-common-data-service-in-power-automate/
LikeLike
Thanks a lot for this post. It was very useful for me! Cheers!
LikeLiked by 1 person
Thank yo so much for your kind words!
LikeLike
Thanks a lot for this post. It was very useful for me! Cheers.
LikeLiked by 1 person