Collect Feedback From Microsoft Teams Using Power Automate

In this article, we'll turn our attention toward designing a feedback card using Low Code Solution. Here I am going to articulate how to collect a feedback response from a MS Teams User and update the response back into sharepoint online list as data source.
 
Power Automate has below actions under Microsoft Teams Connector (which is in preview mode as of now).
  1. Post an adaptive card as the Flow bot to a Teams user, and wait for a response
  2. Post an adaptive card as the Flow bot to a Teams channel, and wait for a response
Once the adaptive card posted into MS Teams User or Channel with above defined actions. Power Automate instance will wait (async call) unless user didn't respond.
Power Automate  documentation maximum waiting time for async call is 30 days. 
 
Prerequisites
  1. Adaptive Card Designer refernece
  2. Power Automate i.e. Create Automate workflow reference
  3. SharePoint Online Cusotm List (Ticket Details & Feedback). Based on status of ticket i.e. closed  power automate post adaptive card respone to MS Teams User. Once User respond , user input will get store into data source i.e. feedback sharepoint online list.
  4. Microsoft Teams access 
Lets start with power automate creation
  1. Login to https://flow.microsoft.com
  2. Create an instant flow with trigger "create or update sharepoint online list item"
  3. Create two SharePoint List i.e. Ticket Details & Feedback Response 
On ticket detail status change trigger the feedback card.
 
 Column Name  DataType  Default Value
 Title Single Line Of Text   
 RequestorName People Picker  
 Ticket Status Choice  
new, assigned,in progress
on hold,resolved,closed
cancelled
 Ticket Description Multi line text  (Plain)
 
Another List name Feedback Response,
 
 Column Name  Data Type  Default Value
 Title  Single Line Of Text  
 Feedback Comment  Multiple Line Of Text   
 Raiting  Number  
 Ticket Id  Single Line Of Text  
 
Add an action "When an item is created or modified: in SharePoint Online List.
 
 
 
Note
In this scenario, As item get updated, power automate will get trigger and check the condition ticket status has closed or not. If ticket status has closed, then condtion will be true and it will trigger the rest of action to continue
 
Add another action "Post an Adaptive Card to a Teams user and wait for a respnse"
  • Add Requestor Name (it can be find in ticket table, who has created a ticket)
  • Enter the Messgae 
  • Select "Should Update Card" Yes 
 
 
Click Create Adaptive Card and it will prompt adaptive card designer within same context.
 
 
Select Card Payload Editor and Paste below JSON or You are free to design the card as per your requirement. 
  1. {  
  2.     "$schema""http://adaptivecards.io/schemas/adaptive-card.json",  
  3.     "type""AdaptiveCard",  
  4.     "version""1.2",  
  5.     "body": [  
  6.         {  
  7.             "type""TextBlock",  
  8.             "text""Ticket ID : @{triggerOutputs()?['body/ID']}",  
  9.             "size""large",  
  10.             "weight""bolder",  
  11.             "wrap"true  
  12.         },  
  13.         {  
  14.             "type""TextBlock",  
  15.             "text""Ticket Detail: @{triggerOutputs()?['body/Title']}",  
  16.             "isSubtle"true,  
  17.             "spacing""None",  
  18.             "wrap"true  
  19.         },  
  20.         {  
  21.             "type""TextBlock",  
  22.             "text""We would love to hear your thoughts, concerns or problems so we can improve.",  
  23.             "wrap"true  
  24.         },  
  25.         {  
  26.             "type""Input.ChoiceSet",  
  27.             "id""Feedback",  
  28.             "value""",  
  29.             "choices": [  
  30.                 {  
  31.                     "title""Bad",  
  32.                     "value""1"  
  33.                 },  
  34.                 {  
  35.                     "title""Poor",  
  36.                     "value""2"  
  37.                 },  
  38.                 {  
  39.                     "title""Moderate",  
  40.                     "value""3"  
  41.                 },  
  42.                 {  
  43.                     "title""Good",  
  44.                     "value""4"  
  45.                 },  
  46.                 {  
  47.                     "title""Excellent",  
  48.                     "value""5"  
  49.                 }  
  50.             ]  
  51.         },  
  52.         {  
  53.             "type""Input.Text",  
  54.             "id""Comments",  
  55.             "placeholder""What can we do to make it better?",  
  56.             "maxLength": 250,  
  57.             "isMultiline"true  
  58.         }  
  59.     ],  
  60.     "actions": [  
  61.         {  
  62.             "type""Action.Submit",  
  63.             "title""Send Feedback"  
  64.         }  
  65.     ]  
  66. }  
Create Item based on user response into Feedback List
 
 
Comment and Rating value will be populated from teams response, If value doesn't exist in your case , you can use below formula
 
Comment ;- @{body('Post_an_Adaptive_Card_to_a_Teams_user_and_wait_for_a_response')?['data']?['Comments']}
Rating :- @{body('Post_an_Adaptive_Card_to_a_Teams_user_and_wait_for_a_response')?['data']?['Rating']} 
 
Validate and Save with user friendly name. 
 
Once ticket status gets closed or user can manually chnage the status in the backend for testing purposes, Feedback Card will be post to indiviual user based on status.
 
Flow Bot will post the feedback card to ticket creator. 
 
 
Now user needs to respond or provide the feedback within 30 days (time out limitation for power automate).
 
 
User can select the rating from dropdown and provide the relevent comments. Once user submits the response, user input will get stored into feedback response list.
 
 
I hope you enjoyed and learned something new in this article.  Thanks for reading and stay tuned for the next article.