Microsoft Flow: Retrieve N:N records in D365

In this blog, we’ll see how we can retrieve N:N records using Microsoft Flow. Below are the steps:

Go to https://flow.microsoft.com and login. After successful login select CDS connector.

For demo purpose, let’s select “When record is updated” as the trigger point.

Select Organisation, Entity Name and Scope as shown and click New Step.

Search for list record and select List Records from the result

Select required Organisation. For entity name click on the down arrow and scroll down to the end to select “Enter custom value” as shown.

To get the entity name for N:N relationship, go to the following URL and search for the N:N relationship schema name: https:// [OrganisationName] .api.crm [Version] .dynamics.com/api/data/v9.0/.

We can see that, the entity name is in the format <N:N relationship name>set. If we use only relationship name as the entity name then we’ll get the error “Table with name ‘relationship name’ does not exist” while executing the flow.

After putting the entity name that we got from the above URL, apply any additional filter if required. In this case, we are trying to get the related records of a particular revenue schedule line record.

Once done, execute the flow to get the result in JSON format as shown below. In our case we got only 1 record based on the filter criteria we had provided.

NOTE: There might be some more action that you need to perform based on the requirement after retrieving the records e.g. updating a field in the related records. In our case, we wanted to update each related record that we got in the result which will be covered in the next blog.

Hope it helps !!

Advertisements

One thought on “Microsoft Flow: Retrieve N:N records in D365

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.