Introduction to Building a Smart Feedback Agent
In today's digital landscape, providing seamless and intelligent feedback mechanisms is crucial for improving user experiences. By leveraging Copilot Studio, Adaptive Cards, and Power Automate, you can create a smart feedback agent that not only interacts with users but also collects and processes feedback efficiently.
Microsoft Copilot Studio
Copilot Studio is a powerful tool that allows you to build, test, and deploy conversational agents using natural language. With its intuitive interface, you can create agents that understand and respond to user queries, making the interaction more human-like and engaging.
Adaptive Cards
Adaptive Cards are a way to present and collect information in a visually appealing and interactive manner. By integrating Adaptive Cards into your feedback agent, you can gather user feedback seamlessly after each interaction. This ensures that the feedback process is smooth and non-intrusive.
Power Automate
Power Automate enables you to automate workflows and processes. By connecting your feedback agent with Power Automate, you can automate the collection, analysis, and response to user feedback. This integration helps in streamlining the feedback loop and ensures timely responses and improvements.
This blogpost will lead you through the process of creating a feedback agent with interactive adaptive cards and sending the feedback results to the relevant person using Power Automate. Ideal for enhancing organizational efficiency and user engagement. Check out as we configure our copilot to gather input using an adaptive card and send feedback emails to the relevant person using Power Automate.
Lets do it!!!
Step 1. Create a feedback agent by using Microsoft Copilot Studio
- Login into Microsoft Copilot Studio and select your environment. Select +Create. Then select New agent.
- Enter the name as Feedbacks Service Agent. On the description box please enter the following description.
This feedback agent collects user feedback after each interaction with the system. It uses Adaptive Cards to prompt users for their feedback on the quality and relevance of the responses they received. The feedback is then analyzed to identify areas for improvement and enhance the overall user experience.
- Enter the following instructions at the instruction box.
Role: You are a feedback agent responsible for collecting user feedback after each interaction. Format: Collect feedback in a structured format with fields for 'Overall Experience', 'Suggestions for Improvement', and 'Additional Comments'. Use a friendly and encouraging tone. Context: Ask for feedback specifically about the accuracy and helpfulness of the responses provided during the interaction. Include questions like -Rate your satisfaction on a scale of 1 to 5' and 'Provide any additional comments. Exclusions: Do not ask for personal information or sensitive data. Adaptive Cards: Use an Adaptive Card to present feedback questions and collect responses. Follow-Up: Send the collected feedback to the designated team for review and analysis.
- After entering all these details please select Create.
Step 2. Configure Topics
We can enable the orchestration of Generative AI, so that our agent can use generative AI to determine how best to respond to users and events.
After enbaling Generative AI please select Topics from the top and select first conversation.
- We are updating the conversation start message as below:
We hope you had a great experience using our service today. We would love to hear your thoughts and feedback to help us improve. Could you please take a moment to share your experience with us? Here is the form for it.
- After entered the start message please select Save. Then refresh the Test your agent pane and you can see the start message has been changed there.
- Select Add node, then select Ask with Adaptive card.
- Click on the Adaptive card node, a sidescree will open with JSON script. Select Open Adaptive Card designer to design our feedback form.
- Enter the following JSON script into the Card payload editor.
{ "type": "AdaptiveCard", "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "version": "1.0", "body": [{ "type": "TextBlock", "text": "We value your feedback!", "weight": "Bolder", "size": "Medium" }, { "type": "TextBlock", "text": "Name", "weight": "Bolder", "size": "Medium" }, { "type": "Input.Text", "id": "name", "placeholder": "Enter your name" }, { "type": "TextBlock", "text": "Email", "weight": "Bolder", "size": "Medium" }, { "type": "Input.Text", "id": "email", "placeholder": "Enter your emailId" }, { "type": "TextBlock", "text": "Rate your satisfaction", "weight": "Bolder", "size": "Medium" }, { "type": "Input.ChoiceSet", "id": "satisfaction", "style": "expanded", "choices": [ { "title": "1 - Very Dissatisfied", "value": "1" }, { "title": "2 - Dissatisfied", "value": "2" }, { "title": "3 - Neutral", "value": "3" }, { "title": "4 - Satisfied", "value": "4" }, { "title": "5 - Very Satisfied", "value": "5" } ] }, { "type": "Input.Text", "id": "comments", "placeholder": "Additional comments", "isMultiline": true } ], "actions": [ { "type": "Action.Submit", "title": "Submit" }] }
On the top you will get a preview as below:
If you want to change the format you can do it here.
- Copy the same script and paste it in the Adaptive card designer node in Microsoft Copilot Studio and select Save.
- Refresh your Test your agent pane, you can see the form now appear along with the agent message.
- At the Output section you can see five variables has been created.
- Select each variable and make it as Global and then Save.
** All the variables are global now.
- Select Add node, then select Call an action and then select Create a flow.
You will be redirected to Power Automate page.
- Select Run a flow from copilot, then select +Add Input.
- Add four inputs for our four variables.
These are the four variables we have in the Adaptive card script.
Add an action after the Run a flow from copilot step.
Select Send an email(v2) from the Add an action screen.
- On the To section provide an email address to whom you to sent the feedback. Subject you can enter Feedback Result. Then on the Body enter the following: Following are the feedback recieved.
Name of the customer : @{triggerBody()?['text']}
Email : @{triggerBody()?['text_1']}
Feedback : @{triggerBody()?['text_3']}
Comments : @{triggerBody()?['text_2']}
Thanks !!!
Please note the triggerBody section you can dynamically select. After entered all the details, it looks as below:
- Change the flow name and select publish.
- After publishing the flow, go back to Copilot Studio and select Done. Then select Feedback flow from Call an action.
- At the action section provide the values of all four power automate inputs. For example:
After giving values the action section looks like below:
- Add another node for Send a message. Then provide the below message and save it:
You have successfully submitted your feedback. One of our team member will shortly contact you.
Thank you
- Publish your Feedback Service Agent by clicking on Publish button from the top.
- Refresh the Testing pane and start testing your agent by entering the details in feedback form.
- Then select Submit.
If its asking for permission required, please select Connect. On the Manage your connections select Connect. On Create/Pick connections screen please select submit, once status became connected, please go to Copilot studio again and select Retry.
- Now you can see the successful message as below:
- You will receive an email as well.
Successfully completed a small example of creating a custom Copilot by using Microsoft Copilot studio with Adaptive card and Powerautomate.
Hope you enjoy the session.
Thank you for reading
Please leave a comment below if you have any further questions.
Happy Sharing !!!
Keep Learning | Spread Knowledge | Stay blessed |
Top comments (1)
Very usefull