Edit

Xrm.Copilot (Client API reference)

Provides methods for interacting with Microsoft Copilot in model-driven Power Apps, including preview APIs for executing registered Microsoft Copilot Studio topics.

Generally available methods

Method Description
addActionHandler Registers a custom handler function for a Microsoft Copilot action.
addDefaultActionHandlers Restores the platform-default handlers for a Microsoft Copilot action.
getCurrentAgent Returns the currently active Microsoft Copilot agent, or undefined if the agent state is not yet known.
isM365CopilotEnabled Returns whether Microsoft Copilot is enabled in the current environment.
openM365CopilotPanel Opens the Microsoft Copilot side panel.
removeActionHandler Removes a previously registered custom handler for a Microsoft Copilot action.
removeDefaultActionHandlers Removes the platform-default handlers for a Microsoft Copilot action.
sendPromptToM365Copilot Sends a prompt to the Microsoft Copilot side panel, causing Copilot to process and respond on behalf of the user.
updateContext Sends updated app context to the Microsoft Copilot side panel.

Preview methods

Method Description
executeEvent (preview) Executes a Microsoft Copilot Studio topic based on the registered Event Name. Returns an array of type MCSResponse.
executePrompt (preview) Executes a Microsoft Copilot Studio topic based on the trigger queries registered in the topic. Returns the array of type MCSResponse.

Interfaces

Interface Description
M365CopilotAgent Describes the currently active Microsoft Copilot agent — returned by getCurrentAgent.
M365CopilotAgentMode Describes how a Microsoft Copilot agent is being referenced.
MCSResponse Describes the data returned by the executeEvent and executePrompt methods.
PowerAppsContent Describes the context data passed to the updateContext method. All properties are optional.
SendPromptToM365CopilotOptions Describes the optional parameters passed to the sendPromptToM365Copilot method.

Client API Xrm object