Handle responses from Adaptive Cards in Microsoft Teams using different cloud flow
Vložit
- čas přidán 25. 07. 2024
- That's a hot new functionality, still available only in preview environments ( docs.microsoft.com/en-us/powe... )!
It allows you (FINALLY!) to send Adaptive Card to Microsoft Teams using one cloud flow and then handle the responses from that card using another flow. Thanks to that, you're able to overcome the 30 days waiting limit plus start building awesome business solutions!
Still waiting for more actions, like the one which would allow us to update an Adaptive Card using the second cloud flow, and I hope they will arrive to complete this jigsaw puzzle.
Chapters:
0:00 Intro
2:28 Posting Adaptive Card to Teams
5:33 New trigger for MS Teams: When someone responds to an adaptive card
7:30 Bind response with listener - Card Type Id
9:00 Working solution
10:32 What am I still missing in this jigsaw puzzle?
12:40 Wrap up
Great video ! I was looking for this feature as standard from Action in Power Automate.
Thank you for sharing this
Great Info and hopefully in the future it will improve. Thanks 👍
I am glad reading that :)
Great Video! Is it possible to explain what was inserted into the First function?
Which first function? Can you share the time?
@TomaszPoszytek Thanks for a great video! I can´t however grab the response value from the user in the response flow (when someone responds to an adaptiv card). Flow is triggered, but the cardOutputs property is empty. Any idea why?
Oh, there may be many reasons. For example, you are referencing wrong ID in the response body - not related to a field, that you want to send data from. Or that it is not escaped. Or, or or :)
Hi Thomasz. Really useful video and a great pattern. Unfirtunatley ( and I think this is a common issue) the flow that is triggered by"When someone responds to an adaptive card" doesn't fire for me even though the adaptive card json and Card Type Id are the same as in teh invoking flow. I also note that we can now update a card.
Remember it has to be created in a default environment and not in a solution...
@@TomaszPoszytek Wow, this is confusing from Microsoft. Just to clarify more, default envitonment is really "default environment of your company" (!). It can't even be created out of solution in enviroment of your project/department/division etc. Very strange and this should be written somewhere with huge text and 10times underlined :-))... took 3 hours of my life.
Hi Thomasz !
Thank you for this helpful video.
IS there a way to "listen" an updated adaptive card ? I don't figure out how to pass the Card Type Id to the action "Update an adaptive card in chat or channel".
Thanks !
The Card Type Id is for the trigger "When someone responds to an Adaptive Card": czcams.com/video/2ZHv0l_6W5Q/video.html&ab_channel=TomaszPoszytek
Hello Tomasz, Not sure if you noticed that now there is no 'Card Type ID' field under Post adaptive card to chat or Channel task. it has changed to "hosted Contents". Do you know how should we do now? Thanks!
Resolved it after read others' comments, changed to send through flowbot then the Card Type ID appears and it works perfect. Thanks a lot for the video and guidance.
Glad you made it work ☺️
Hi Tomasz,
Nice info. Will this work if adaptive card is posted through microsoft graph API?
It will not.
Hello, I still have problems with the trigger "When someone responds to an adaptive card". If I click on the card myself, the flow is triggered, if another user clicks on this card then not.
The flows are both in the default. I don't understand why it doesn't respond to the others' responds?Maybe someone can help me?
As far I know the trigger is still in preview. Maybe this is the reason. Basically it should let you get responses to the card that was sent by you, but completed by anyone else.
Hello, great video. I have a logic app in azure environment with a adaptive card .And the response adaptive card is in power automate. Will it still work ? Or does both have to be in power Automate ? Because when I run the logic app in azure, it says error “ environment id is null or empty “. Could you kindly give your input ?
Thanks! Which action is in Power Automate and which in Logic Apps?
@@TomaszPoszytek I haven’t got notifications of your reply. Thank you for replying back. The response is in power automate ( the one you have explained ) and the trigger is in logic app( where it post the adaptive card with card type id same as in the one in power automate ). I get environment id null or empty. Thank you again
@@abinayamuthusamy7479 well since it is triggered from Logic Apps there's no environment context, so that doesn't surprise me...
@@TomaszPoszytek is there anyway to make it work ?
@@abinayamuthusamy7479 i don't know tbh. Maybe some kind of workaround is to create a cloud flow triggered by http and use it from your logic app, to actually post Adaptive Card?
In the latest Power Automate version, the "When someone reply to an adaptive card" trigger now has a Body property and no "Card Type Id" property. But there is a new tab called Parameters and there's a Tracking Id in that tab. Is that the field we need to use in place of "Card Type Id" ?
Nope, that unfortunately seems to be a bug of the new PA designer :( When you switch to the old version all is in place.
@@TomaszPoszytek This haven't been fix yet, right? Still need to use old PA design
How do you close the adaptive card when submit is pressed? It's very weird that it stays in the teams chat.
Using the "Reply with Adaptive Card in a channel". Unfortunately you can't make it in a private conversation with user.
Hi Tomasz Thanks for sharing the amazing content, but why is it only functioning in the Default Environment? Even after so many years, this trigger hasn't been upgraded to Dev and Production Environments.
Yes, exactly. But as for the reason - I really have no idea.
Hello. I am wondering if you can help me as i am desperate.
I have a bot posting the adaptive card to a user. However when the user clicks submit, I get the error "the initiator is not a member of the roster in the generic thread".
I believe that happens because the Flow bot initiates the chat with the user and when I try to update the card i use my own account so i get the above error.
Do you have any workarounds for that? Thank you in advance!!
Great videos!
Thank you. As per the solution - maybe the childflow, that runs using specific account, would be a solution, so that always a card and the update will happen using the same account?
Great video. One note on language: "mustn't" in English is very categorical (pl nie może). It is not the same as "doesn't have to" (pl nie musi).
Thanks :) I'll try to memorize this :)
Tomasz- You mentioned you were hoping that MS comes up with new actions to update/refresh the card. Have they done that yet? Thanks
Yes, there is such an action. It allows you to update a card, and must be used in combination with trigger „when someone responds to adaptive card”.
FINALLY! Learn how to update (or replace) an Adaptive Card sent to Microsoft Teams
czcams.com/video/2ZHv0l_6W5Q/video.html
Hello Tomasz, maybe you can help me. I created a card in the card designer to get a text string response. In my card I put some dynamic content but when I use the cards code in the listener trigger I get an error. Do you know if dynamic content is allowed to be used in the post card and in the listener card? After removing the dynamic content it works fine but that limits the trigger since I would need to have more entry data into the card. Any suggestions are welcome. Thank you.
Do you mean the „when someone responds to an adaptive card” trigger? If yes, then you can’t put any dynamic content there.
@@TomaszPoszytek yes, I found that out. For anyone having the same issue just paste the card design in the listener trigger and then delete the dynamic content and it works fine. I didn't know if they had to match perfectly for it to work.
@@kyleadammason Were you able to work with the dynamic content afterwards in other actions? For me, it does not work out :/
@@JakobElfner yes I was. I think the only thing you can really work with are items from the card output section. You can always add things to that by adding data to buttons using the adaptive card designer tool. The format for data goes like this " "title": "data" ". Use this in your card that is being sent and it should show up as something you can use in your listening card.
What if I'm not able to see the "show advanced options" on my post action? Can I set the ID another way?
No, unfortunately not. It means that the update possibly haven't reached your tenant yet.
I noticed that if I post the card as flow bot I do get the option, but not if I post as a user.
@@momosworkshop ah yes. This option is only available when you post it as flow bot.
@@TomaszPoszytek it's unfortunate because my enterprise doesn't give access to posting as flow bot, so it really limits what I'm able to do with adaptive cards
@@momosworkshop oh how's that possible? Can this be limited? I didn't know.
Doens't work for me unfortunately. As soon as I set the Card Type ID I get error "Environment id is null or empty" :(
What is sending you the card in the first place?
Hi Tomasz, hoping you can help, i have copied your part of the adaptive card JSON underneath the Action.Submit for the hidden data, i know in yours you have the Team and Channel ID, in mine im looking to carry through a SharePoint list ID so i can update a row in a SharePoint list with outputs from the adaptive card but i cant seem to find it on the second cloud flow
Original Card when input is given
{
"type": "ActionSet",
"id": "ActionSet2",
"actions": [
{
"type": "Action.Submit",
"title": "Submit",
"associatedinputs": "auto",
"style": "positive",
"data": {
"ListID": "@{outputs('Create_item_2')?['body/ID']}"
}
}
]
}
Outputs i get from the second flow triggered when there is a response to the adaptive card which is from my input.text box
},
"cardOutputs": {
"inputComments": "Test Comments"
}
Remember to include headers and authentication properties. This may be the reason.
Did you find a solution? I am having the same issue.
Does anyone get a "Unable to reach app. Please try again" when trying to submit the response in Teams?
Are you using default environment?
@@TomaszPoszytek yes, I have a single environment
hey there, why aren't you showing and explaining the expression you are using and filter area ?
Which step is unclear?
@@TomaszPoszytek I see you were using the expression First() yet you never explained that clearly. My advice is that you should always time to expand and explain each step.