Creating Thumbs Up and Thumbs Down Feedback in Copilot Studio with Adaptive Cards and Storing Data in Dataverse Using Power Automate
Providing users with an easy way to give feedback is crucial for improving the performance and user experience of your AI copilot. In this blog post, we'll walk you through the steps to create a thumbs up and thumbs down feedback mechanism using Adaptive Cards in Copilot Studio and store the feedback in Microsoft Dataverse using Power Automate with a Power Virtual Agent trigger.
What are Adaptive Cards?
Adaptive Cards are a way to present and collect information in a flexible and visually appealing manner. They are platform-agnostic snippets of UI that can be integrated into various applications, including chatbots created with Copilot Studio.
Step-by-Step Guide
Step 1: Set Up Your Copilot in Copilot Studio
Create Your Copilot:
- Use Copilot Studio to design and configure your AI copilot. Define its capabilities, responses, and integrations.
- Test your copilot within Copilot Studio to ensure it works as expected.
Navigate to the Adaptive Cards Section:
- In Copilot Studio, go to the section where you can create and manage Adaptive Cards.
Step 2: Design the Adaptive Card
Create a New Adaptive Card:
- Click on the option to create a new Adaptive Card.
- Use the Adaptive Card Designer to visually design your card.
Add Thumbs Up and Thumbs Down Buttons:
- Add two
Action.Submit
buttons to your card. One for thumbs up and one for thumbs down. - Customize the buttons with appropriate icons and labels.
- Add two
Here’s an example JSON for the Adaptive Card:
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.3",
"body": [
{
"type": "TextBlock",
"text": "Did you find this response helpful?",
"weight": "Bolder",
"size": "Medium"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "👍 Thumbs Up",
"data": {
"feedback": "thumbs_up",
"conversation_id": "12345"
}
},
{
"type": "Action.Submit",
"title": "👎 Thumbs Down",
"data": {
"feedback": "thumbs_down",
"conversation_id": "12345"
}
}
]
}
Step 3: Set Up Dataverse
Create a Table in Dataverse:
- Go to the Power Platform admin center and navigate to Dataverse.
- Create a new table named
Feedback
. - Add the following columns to the table:
Feedback ID
(Primary Key, Auto Number)Conversation ID
(Text)Feedback Type
(Choice: Thumbs Up, Thumbs Down)Timestamp
(Date and Time)User ID
(Text, Optional)Additional Info
(Text, Optional)
Configure Permissions:
- Ensure that the appropriate permissions are set for the application or users who will be submitting feedback.
Step 4: Create a Power Automate Flow with Power Virtual Agent Trigger
Create a Power Automate Flow:
- Go to Power Automate and create a new flow.
- Select the trigger When a Power Virtual Agent calls a flow.
Configure the Flow:
- Add a
Parse JSON
action to extract the feedback data from the request body. - Add an action to create a new row in the
Feedback
table in Dataverse with the captured data.
- Add a
Example Power Automate Flow
Trigger:
When a Power Virtual Agent calls a flow
Actions:
Parse JSON
to extract the feedback data from the request body.Add a new row
in Dataverse to store the feedback.
Example Power Automate Flow JSON
{
"type": "object",
"properties": {
"feedback": {
"type": "string"
},
"conversation_id": {
"type": "string"
},
"user_id": {
"type": "string"
},
"additional_info": {
"type": "string"
}
}
}
Step 5: Integrate the Adaptive Card with Power Virtual Agent
Modify the Adaptive Card:
- Ensure that the Adaptive Card sends the feedback data to the Power Virtual Agent, which will then trigger the Power Automate flow.
Handle Feedback Submission:
- When the user submits feedback, the copilot should send an HTTP POST request to the Power Virtual Agent, which will trigger the Power Automate flow to store the feedback in Dataverse.
Conclusion
By following these steps, you can create a thumbs up and thumbs down feedback mechanism in Copilot Studio using Adaptive Cards and store the feedback in Microsoft Dataverse using Power Automate with a Power Virtual Agent trigger. This setup allows you to collect valuable user feedback and tie it to specific conversations, enabling you to improve your copilot’s performance and user experience.
Comments
Post a Comment