Reference implementation demonstrating how to integrate Microsoft Copilot Studio with PowerApps using the new Agent APIs in PCF controls.
🎥 Watch the Live Demo
Two working examples of PCF controls that call Copilot Studio agents using context.copilot.executeEvent:
- 🏥 Patient Care Assistant - Healthcare recommendations
- 💰 Financial Advisor Assistant - Investment risk analysis
// Call Copilot Studio agent from PCF
const result = await context.copilot.executeEvent(
"healthcare.patient_care_optimization.pcf",
{ id: patientId, symptoms }
);Each PCF includes:
- React + Fluent UI components with loading states
- Agent API service layer with error handling
- Structured response parsing from Copilot Studio
- Bidirectional data binding (input fields → AI → output fields)
Create topics with event triggers matching the PCF calls:
financial.dynamic_risk_optimization.pcfhealthcare.patient_care_optimization.pcf
Note: Ensure you have sufficient AI Builder Credits for the custom prompts to work in the Agent.
npm install && npm run build
pac pcf push --publisher-prefix yourprefix- Add the PCF controls to your forms
- Bind input properties to Dataverse fields
- Bind output properties to fields that should receive AI recommendations
This repository is a reference implementation only. The sole purpose of this project is to demonstrate how to use Agent APIs in Model-Driven Apps forms via PCF controls. This code is provided as-is for educational and demonstration purposes and should not be used in production environments without proper testing, security review, and customization for your specific requirements.




