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

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
Highlighted
Super User
Super User

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

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

5 REPLIES 5
Highlighted
Super User
Super User

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

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 Post Patron
Post Patron

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

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...

 

 

 

Dual Super User
Dual Super User

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

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!



Community Support
Community Support

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

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.

ALBordelon Advocate I
Advocate I

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

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.  

 

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (5,686)