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?
Solved! Go to Solution.
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']
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.
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.
User | Count |
---|---|
93 | |
45 | |
20 | |
19 | |
15 |
User | Count |
---|---|
134 | |
53 | |
44 | |
37 | |
31 |