Microsoft Flow: The Relate Records Action Demystified!

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:

There are two. It’s confusing. I know.

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.

Here she is!

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.

Here are the list of N:N relationships for the Email Send

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!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.