Breyta

sendPromptToM365Copilot (Client API reference)

Sends a prompt to the Microsoft 365 Copilot side panel, causing Copilot to process and respond on behalf of the user.

Syntax

Xrm.Copilot.sendPromptToM365Copilot(promptText, options).then(successCallback, errorCallback);

Parameters

Parameter Name Type Required Description
promptText string Yes The prompt text to send to the Microsoft 365 Copilot side panel.
options SendPromptToM365CopilotOptions No More options, such as a target GPT ID or auto-submit behavior.
successCallback Function Yes A function to call when the operation succeeds.
errorCallback Function Yes A function to call when the operation fails.

Return Value

Type: Promise<void>

Remarks

Does nothing if Microsoft 365 Copilot isn't enabled.

Example

await Xrm.Copilot.sendPromptToM365Copilot(
    "Summarize the recent activity for this account.",
    { gptId: "dddddddd-3333-4444-5555-eeeeeeeeeeee" }
);

SendPromptToM365CopilotOptions
Xrm.Copilot (Client API reference)