cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DWFincher
Frequent Visitor

Waiting for response -- how do you get the response?

Hello. I am using the "Post adaptive card and wait for response" action. The card has two buttons. When clicked, the submittedId is either "Yes" or "No".

 

The card submits to Teams and shows up correctly. The buttons can be clicked, and after clicking one of them, the update message shows up.

 

How do I grab the response from the card? I saw an example about saving the response to a SharePoint list. But I'm not doing that. I just need to get the response itself (i.e., "Yes" or "No"). I might do any number of things with that response. But I have to get it first. I saw another example which had a dropdown and an id for the drop down. It seems that id could be used to get the value of that drop down. But I don't have a drop down. I have two buttons.

 

Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
DWFincher
Frequent Visitor

Alrighty, I finally figured it out by piecing together small bits of various forum posts and documentation snippets.

If the action that the output is coming from is called "ActionName", then the entire output of that action can be obtained via the formula:

 

outputs('ActionName')

That gives a JSON string which can be used to further drill down into the output. Consider the following:

If the output is something like

{
   "headers":{
      "Connection":"Keep-Alive",
      "Accept-Encoding":"gzip,deflate",
      "Host":"some-host.azure.com",
      "client-request-id":"hex-string",
      "x-ms-activity-vector":"AD.14",
      "Content-Length":"441",
      "Content-Type":"application/json; charset=utf-8"
   },
   "body":{
      "responseTime":"2021-08-12T20:10:21.4918829Z",
      "responder":{
         "objectId":"hex-string",
         "tenantId":"hex-string",
         "email":"JohnSmith@example.com",
         "userPrincipalName":"JohnSmith@example.com",
         "displayName":"Smith, John"
      },
      "submitActionId":"Approve",
      "messageId":"111111111111",
      "messageLink":"https://..."
   }
}

 

Then the button which was clicked can be obtained via outputs('ActionName')?['body/submitActionId']

View solution in original post

1 REPLY 1
DWFincher
Frequent Visitor

Alrighty, I finally figured it out by piecing together small bits of various forum posts and documentation snippets.

If the action that the output is coming from is called "ActionName", then the entire output of that action can be obtained via the formula:

 

outputs('ActionName')

That gives a JSON string which can be used to further drill down into the output. Consider the following:

If the output is something like

{
   "headers":{
      "Connection":"Keep-Alive",
      "Accept-Encoding":"gzip,deflate",
      "Host":"some-host.azure.com",
      "client-request-id":"hex-string",
      "x-ms-activity-vector":"AD.14",
      "Content-Length":"441",
      "Content-Type":"application/json; charset=utf-8"
   },
   "body":{
      "responseTime":"2021-08-12T20:10:21.4918829Z",
      "responder":{
         "objectId":"hex-string",
         "tenantId":"hex-string",
         "email":"JohnSmith@example.com",
         "userPrincipalName":"JohnSmith@example.com",
         "displayName":"Smith, John"
      },
      "submitActionId":"Approve",
      "messageId":"111111111111",
      "messageLink":"https://..."
   }
}

 

Then the button which was clicked can be obtained via outputs('ActionName')?['body/submitActionId']

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (2,508)