Managing Dataverse Relationships in Power Automate: Using Row ID and OData ID

I’ve been asked about how to connect and disconnect Dataverse relationships from Power Automate, so here are my notes.

スポンサーリンク

Tables Used in This Example

I’ll explain using the “Cat” table (parent) and “Meal History” table (child) as examples.

Row ID and OData ID

When handling Dataverse records in Power Automate, you’ll encounter two types of IDs: “Row ID” and “OData ID”.

Row ID

The Row ID is the value stored in the “Primary Key” column that’s automatically created when you create a table:
A GUID is automatically assigned when a record is created.

This is primarily used when retrieving or editing records.

OData ID

The OData ID is the URI used to retrieve record information from Dataverse. Note: “OData” is a protocol created by Microsoft for data exchange between servers and browsers using HTTP.
When you open this value in a browser, you can see it returns the record information as shown in the image.

This “OData ID” is also used when establishing relationships from Power Automate.

Connecting Relationships Using the “Associate Row” Action

First, let’s try connecting this “Meal History” record with the “Cat” record.
In the “Associate Row” action, set the [Table name] and [Row ID] to the “parent table” and its “Row ID”, and set the [Related Records] to the “child table’s OData ID”.
When the flow is executed, it works successfully,
and the relationship is established.

Disconnecting Relationships Using the “Disassociate Row” Action

The “Disassociate Row” action uses similar settings – specify the “parent table’s Row ID” and the “child table’s OData ID”:
The action succeeds,
and the relationship is removed.

Connecting Relationships Using the “Update Row” Action

You can also establish relationships using the “Update Row” action. This method is particularly convenient when you want to update values in the child table while simultaneously establishing a relationship.

Use the “Update Row” action on the child table and set the “OData ID” of the parent record in the lookup column where you want to establish the relationship.
The action succeeds and the relationship is established.

Note: The “Add New Row” action also supports relationship configuration in the same way, allowing you to create a record and establish a relationship simultaneously.

Disconnecting Relationships Using the “Update Row” Action

It is technically possible to disconnect relationships using the “Update Row” action.

When using the “Update Row” action on the child table, you can specify “null” for the parent table’s lookup column:
The action succeeds and the relationship is removed.

However, when trying to set “null” in the new designer:
The action mysteriously fails…

Therefore, it might be more reliable to use the “Disassociate Row” action for disconnecting relationships.

Copied title and URL