- Dynamics 365 / Model-driven app (CRM) — side‑pane webresource
- Copilot Studio (Dataverse-connected agent)
- Agent must call Dataverse tools like "Get Row By Id" for whichever CRM record opens the pane
Pass CRM context (table logical name + recordId GUID) from the CRM form into the Copilot agent so Copilot Studio Dataverse tools target the correct table & environment.
- Passing encoded JSON via Xrm.App.sidePanes.createPane(..., data: encodeURIComponent(JSON.stringify({ entityName, recordId }))) and decoding in the webresource.
- Web Chat flow: request token → create DirectLine → dispatch WEB_CHAT/SEND_EVENT on DIRECT_LINE/CONNECT_FULFILLED with { name: 'crm_context', value: { entityName, recordId } }.
- iframe + postMessage to an embedded Copilot webchat page.
- Note: I saw 401/403 when calling dataverse-backed conversation endpoints from the browser — authentication is a separate concern; this post focuses on context shape & transport.
1. Exact payload and field names Copilot Studio expects so Dataverse tools (Get Row By Id) will use the correct table & environment. Example candidates:
- { entityName: "account", recordId: "GUID" }
- { tableLogicalName: "account", id: "GUID", environmentId: "..." }
2. Is entitySetName required, or is logical entityName/table + recordId sufficient?
3. Recommended transport for reliability with Copilot Studio Dataverse tools:
- WEB_CHAT/SEND_EVENT (Web Chat) with a particular event name?
- postMessage to an embedded Copilot iframe?
- server-side injection into session metadata during token creation?
4. Exact event name/structure Copilot expects (example: crm.recordContext, crm_context, or other)?
5. Any Copilot Studio configuration steps (tool input mapping, environment selection, permissions, allowed origins) required so "Get Row By Id" uses the selected Dataverse environment and table.
6. Best practice for multi-entity support (agent invoked from many tables).
- Web Chat event example:
{
"name": "crm.recordContext",
"value": { "table": "account", "id": "40....13-000D3A23CB53", "environmentId": "env-guid-optional" }
}
- postMessage example:
{ "type": "crm_context", "entityName": "account", "recordId": "40D5...CB53" }
- Please confirm the exact JSON shape and event name Copilot Studio expects for Dataverse tools (Get Row By Id).
- Recommend the most reliable transport (short justification).
- Any minimal Copilot Studio config steps / docs links to map incoming context to tool inputs.

Report
All responses (
Answers (