Примечание
Для доступа к этой странице требуется авторизация. Вы можете попробовать войти или изменить каталоги.
Для доступа к этой странице требуется авторизация. Вы можете попробовать изменить каталоги.
Important
- This is a preview feature.
- Preview features aren’t meant for production use and might have restricted functionality. These features are subject to supplemental terms of use, and are available before an official release so that customers can get early access and provide feedback.
Agent APIs are a set of interfaces introduced in Microsoft Power Apps that allow components to interact with topics created in Microsoft Copilot Studio. These APIs are available in two forms:
Context.Copilot
methods used for PCF controls. This is the subject of this article.- Xrm.Copilot namespace used for client scripts in model-driven apps.
These APIs are designed to enhance integration with Microsoft Copilot Studio, enabling more intelligent and responsive app experiences. The APIs use a single Copilot Studio agent that is either:
- Interactive agent selected in the model app designer of custom apps. See more at Working with an interactive agent.
- Model app containing lead or opportunity table, which implicitly uses the "Copilot in Dynamics 365 Sales" agent.
API | Description |
---|---|
copilot.executeEvent | Executes a Microsoft Copilot Studio topic based on the registered Event Name. Returns an array of type MCSResponse. |
copilot.executePrompt | Executes a Microsoft Copilot Studio topic based on the trigger queries registered in the topic. Returns an array of type MCSResponse. |
Accessibility
When creating a code component, ensure the following best practices in code component accessibility checks are followed to have an accessible experience.
Related articles
FAQ for Agent APIs and Agent Response component
Copilot
executeEvent
executePrompt
Working with an interactive agent
Power Apps component framework overview
Create your first code component
Learn Power Apps component framework
Xrm.Copilot (Client API reference)
Add agent response with the form designer (preview)