Skip to main content

Relationships

Relationship steps manage the connections between Dataverse records - associating and disassociating related entities.

All four relationship steps share a common set of parameters. Entity Logical Name / Entity ID identify the primary record, Other Entity Logical Name identifies the related entity type, and Relationship Schema Name is the relationship to act on. For many-to-many relationships, Entity Role (Entity1, Entity2, or Any) disambiguates which side of a self-referential relationship the primary record plays.

Associate Relationship

Links a related record (or reference) to a primary record via a relationship.

ParameterDescription
Entity Logical NameThe primary entity type
Entity IDThe primary record ID
Other Entity Logical NameThe related entity type to associate
Relationship Schema NameThe relationship schema name
EntityThe related record/reference to associate
Entity Role(Many-to-many) the role of the primary record: Entity1, Entity2, or Any

Example:

ASSOCIATE RELATIONSHIP
Entity Logical Name: account
Entity ID: Customer.Id
Relationship Schema Name: account_contacts
Other Entity Logical Name: contact
Entity: NewContact

Associate Multiple Relationships

Links multiple records to a single record in one operation.

ParameterDescription
Entity Logical NameThe primary entity type
Entity IDThe primary record ID
Other Entity Logical NameThe related entity type to associate
Relationship Schema NameThe relationship schema name
EntitiesCollection of related records/references to associate
Entity Role(Many-to-many) the role of the primary record: Entity1, Entity2, or Any

This step is more efficient than calling Associate Relationship multiple times in a loop.

Example:

ASSOCIATE MULTIPLE RELATIONSHIPS
Entity Logical Name: team
Entity ID: SalesTeam.Id
Relationship Schema Name: teammembership_association
Other Entity Logical Name: systemuser
Entities: NewTeamMembers

Disassociate Relationship

Removes the link between two records.

ParameterDescription
Entity Logical NameThe primary entity type
Entity IDThe primary record ID
Other Entity Logical NameThe related entity type to disassociate
Relationship Schema NameThe relationship schema name
EntityThe related record/reference to disassociate
Entity Role(Many-to-many) the role of the primary record: Entity1, Entity2, or Any

Example:

DISASSOCIATE RELATIONSHIP
Entity Logical Name: account
Entity ID: Customer.Id
Relationship Schema Name: account_contacts
Other Entity Logical Name: contact
Entity: FormerContact

Disassociate Multiple Relationships

Removes links between multiple records and a single record in one operation.

ParameterDescription
Entity Logical NameThe primary entity type
Entity IDThe primary record ID
Other Entity Logical NameThe related entity type to disassociate
Relationship Schema NameThe relationship schema name
EntitiesCollection of related records/references to disassociate
Entity Role(Many-to-many) the role of the primary record: Entity1, Entity2, or Any

Example:

DISASSOCIATE MULTIPLE RELATIONSHIPS
Entity Logical Name: campaign
Entity ID: Campaign.Id
Relationship Schema Name: campaignitem_association
Other Entity Logical Name: product
Entities: RemovedProducts

Get Entities by Relationship

Retrieves the records related to a given record via a specific relationship. The Relationship Type determines which set of parameters applies: OneToMany or ManyToMany.

One-to-Many (OneToMany) parameters:

ParameterDescription
Relationship TypeOneToMany
Relationship Schema NameThe relationship schema name
Referenced EntityThe "one" side entity type (holds the primary record)
Referenced Entity IDThe primary record ID on the referenced side
Referencing EntityThe "many" side entity type to retrieve
Referencing Entity PropertiesThe columns to return on each retrieved record

Many-to-Many (ManyToMany) parameters:

ParameterDescription
Relationship TypeManyToMany
Relationship Schema NameThe intersect relationship schema name
EntityThe primary entity type
Entity IDThe primary record ID
Other EntityThe related entity type to retrieve
Other Entity PropertiesThe columns to return on each retrieved record
Entity RoleThe role of the primary record: Entity1, Entity2, or Any

Returns: A collection of related records.

Example - One-to-Many:

GET ENTITIES BY RELATIONSHIP
Relationship Type: OneToMany
Relationship Schema Name: account_contacts
Referenced Entity: account
Referenced Entity ID: Customer.Id
Referencing Entity: contact
Referencing Entity Properties: [ firstname, lastname, emailaddress1 ]
→ Store in variable: CustomerContacts

Example - Many-to-Many:

GET ENTITIES BY RELATIONSHIP
Relationship Type: ManyToMany
Relationship Schema Name: teammembership_association
Entity: team
Entity ID: SalesTeam.Id
Other Entity: systemuser
Other Entity Properties: [ fullname ]
Entity Role: Any
→ Store in variable: TeamMembers

Best Practices

Use Correct Relationship Names: Always use the exact relationship schema name from Dataverse. You can find this in the entity customization area.

Batch When Possible: Use Associate Multiple / Disassociate Multiple when working with several records to improve performance.

Check Existing Relationships: Before associating, consider whether the relationship already exists to avoid duplicate relationship errors.

Handle Many-to-Many Carefully: Many-to-many relationships require using the intersect entity relationship name.