Associate Records
dynamics_crm.associate
ActionCRM & salesconnection required
Calls the Microsoft Dynamics 365 API with the connection's credentials.
Relate two existing rows through a navigation property, such as adding a contact to an account or a role to a user.
Connection
- Required
- Yes — the node will not save without one
- Auth type
- OAuth 2.0
- Providers
- Microsoft Dynamics 365
- Secret shape
- {"client_id": "…", "client_secret": "…", "refresh_token": "…"}
- Config it needs
- org_url, tenant, api_version
- Resolved by
- config.connection_id, else node.connection_id
Configuration
7 fields, 4 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
entity_set The entity set to work with: 'accounts', 'contacts', 'opportunities', 'leads', 'incidents' (cases), 'tasks', or any other table's entity set name, including custom tables. It is the plural name from the table's 'Copy set name' in Power Apps, which is not always the plural of the table name. | string | Yes | — | — | accounts |
record_id The row's primary key GUID, or an alternate-key predicate such as firstname='Joe',emailaddress1='joe@contoso.com'. | string | Yes | — | — | 00000000-0000-0000-0000-000000000001 |
navigation_property The navigation property on this row that names the relationship, for example contact_customer_accounts on an account or systemuserroles_association on a user. | string | Yes | — | — | contact_customer_accounts |
target_entity_set The entity set of the row being related. Name it together with 'target_record_id' — the two address the related row between them — or give 'target_url' instead. | string | No | — | — | contacts |
target_record_id The id of the row being related, in the entity set named by 'target_entity_set'. Both are needed together: an entity set without an id does not name a row. | string | Yes | — | only with target_entity_set | 00aa00aa-bb11-cc22-dd33-44ee44ee44ee |
target_url An absolute URL to the related row, instead of naming its entity set and id separately — for example the @odata.nextLink-style row URL an earlier step returned. | string | No | — | — | https://contoso.crm.dynamics.com/api/data/v9.2/contacts(00aa00aa-bb11-cc22-dd33-44ee44ee44ee) |
relationship_kind Whether the navigation property holds a collection of rows (one-to-many from the 'one' side, or either side of a many-to-many) or a single related row (the 'many' side of a one-to-many). | string | No | collection | one of "collection", "single" | — |
- At least one of target_url, target_entity_set must be set.
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"entity_set": "accounts",
"navigation_property": "contact_customer_accounts",
"record_id": "00000000-0000-0000-0000-000000000001",
"relationship_kind": "collection",
"target_entity_set": "contacts",
"target_record_id": "00aa00aa-bb11-cc22-dd33-44ee44ee44ee",
"target_url": "https://contoso.crm.dynamics.com/api/data/v9.2/contacts(00aa00aa-bb11-cc22-dd33-44ee44ee44ee)"
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
entity_set The entity set holding the row that was related. | string | — |
record_id The row the relationship was added to. | string | — |
navigation_property The navigation property that was set. | string | — |
target The absolute URL of the related row. | string | — |
associated True when Dataverse accepted the association. | boolean | — |
{
"associated": false,
"entity_set": "",
"navigation_property": "",
"record_id": "",
"target": ""
}Notes
- Use this for two rows that already exist. To set a lookup while creating or updating a row, use @odata.bind in 'data' instead — it is one call rather than two.
- Name the related row either with 'target_url' or with 'target_entity_set' and 'target_record_id' together; Dataverse needs an absolute URL in the $ref body and the node builds one from the pair.
Related Microsoft Dynamics 365 nodes
See Associate Records run in a workflow.
In a technical demo we add the Microsoft Dynamics 365 connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.