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

3 REPLIES 3
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']

Hiya, I'm having this issue as well and this is very helpful.  Would you possibly be able to show this within the context of a flow?  I really need the visual.

PaddyWann
Advocate I
Advocate I

Hi, you can put this into your JSON. I hope I understood your question correctly, but this allows your button to send a payload of whatever you have a available. 

 

PaddyWann_0-1670888147660.png

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (6,389)