cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ALBordelon
Advocate II
Advocate II

How to reference Post an Adaptive Card to a Teams channel and wait for a response

I am struggling to reference the response from "Post an Adaptive Card to a Teams channel and wait for a response"

 

My flow is simple:

  • When a new item is added to a list
  • Post a Card to get an Email Address for the Assigned To
  • Update the list item with the Email address in a text field

 

AC1.png

 

In my card I have one data collection field: ac_AssignedTo

 

ac2.png

 

I have tried the following to update the text field:

(‘Post_an_Adaptive_Card_to_a_Teams_channel_and_wait_for_a_response’)?[‘body’][‘data’][‘ac_AssignedTo’]

(‘Post_an_Adaptive_Card_to_a_Teams_channel_and_wait_for_a_response’)?[‘body/data/ac_AssignedTo’]

 

Each time I get Invalid Expression

 

I ran a test and in the Body I did get the following output:

AC3.png

 

I also tried shortening the name of the Adaptive Card action and still the same result.  

 

1 ACCEPTED SOLUTION

Accepted Solutions
DeepakS
Super User
Super User

Hi @ALBordelon 

 

Try following expression:

 

body('Post_an_Adaptive_Card_to_a_Teams_user_and_wait_for_a_response')?['data']?['ac_AssignedTo']
 
-------------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

6 REPLIES 6
DeepakS
Super User
Super User

Hi @ALBordelon 

 

Try following expression:

 

body('Post_an_Adaptive_Card_to_a_Teams_user_and_wait_for_a_response')?['data']?['ac_AssignedTo']
 
-------------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

sudharsan1985
Super User
Super User

Hi @ALBordelon 

I had created a sample flow to post an Adaptive Card when a new item is created. I had captured the output of the AC in a variable. Please look at the screenshot below.

AC Output.pngAC String Output.png

 Following is the expression used

body('Post_an_Adaptive_Card_to_a_Teams_channel_and_wait_for_a_response')?['data']?['myName']

 

Hope it helps, please like it or mark it as a solution if it resolves ur clarification or issue

-Sudharsan K...

 

 

 

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

Hi!

JUst as a general comment, I am afraid output from an adaptive card are not available as Dynamic Content yet, but you can access them with expressions by investigating its outputs:

Flow_AdaptiveCard_outputs_1.png

The structure of the Adaptive Card in my example does not match the one you are using, butthe overall output should look similar

Now, for simplicity, let's assume I recall my "Post an adaptiveCard as FlowBot to a channell wait for for a response Tag" action block as "PostACandWait'.

I can access the whole object by adding the following expression:

outputs('PostACandWait')?['body']

 

Now on my particular Adaptive Card design, I can also access the comment provided by the responder by using the following expression

outputs('PostACandWait')?['body']?['data']?['comment']

 

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



v-litu-msft
Community Support
Community Support

Hi @ALBordelon,

 

It is wired, I try to reproduce the Flow you created, and I find the I could get the ac_AssignedTo dynamic content in the following action directly, could you please share the adaptive card in the Post action?

Annotation 2020-03-13 170746.png

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

In the compose function i have the following:

 

output('PostCard')?['body']?['data']?['ac_AssignedTo']

 

Compose.png

You can then use the output in your next steps.  

 

Unfortunately I see none of the dynamic actions you're seeing, @v-litu-msft 😞 Are you on some more advanced preview track compared to the rest of us plebs? 😛 

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (55,901)