question

60827847 avatar image
0 Votes"
60827847 asked 60827847 commented

Adaptive Card in Teams

Created an adaptive card and posted on teams which is barely a group of 10 people.
I want to record all those 10 person's responses on SharePoint List.

Issue I am facing is, whenever an individual fills that card response, card message get closed with only one response and other 9 people are not able to fill their responses.

I want to make it use for all 10 people like, if we post the Microsoft form, it will stay open until everyone respond to it, every single person can fill it. Here, I am not seeing that kind of option in Adaptive cards.

Please suggest if any solution on this.

office-sharepoint-onlineazure-logic-appsoffice-teams-app-dev
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @9795,

The "office-teams-windows-itpro" tag is for general questions about Teams desktop client. Since Adaptive card is more related to development, I'll change the tag to "office-teams-app-dev" instead so that their community members can help look into this.

0 Votes 0 ·
BrunoLucas-9843 avatar image
0 Votes"
BrunoLucas-9843 answered 60827847 commented

Hi Akshatashete ,
Sorry for rushing up on my answer. I actually found a way to do it. hope may be applicable for you scenario

You first need the collection of users you want to send adaptive cards for. Something similar to this but could be a SharePoint list

192276-image.png

Inside the loop, you can actually use "Post adaptive card and wait for response". make sure you select these options:

192246-image.png
192190-image.png

each user will receive and individual message like this

192209-image.png





image.png (27.8 KiB)
image.png (14.4 KiB)
image.png (14.9 KiB)
image.png (39.0 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@BrunoLucas-9843

with adding in loop, we can able to get all the records from all the users. This solution perfectly worked out for me.

Thank you for spending time and finding this solution.!!!





0 Votes 0 ·

you are welcome! another good suggestion is to add a time out on the teams action. with several users it may sit there waiting case some of them do not respond or go on holiday.

0 Votes 0 ·
60827847 avatar image 60827847 BrunoLucas-9843 ·

Yes exactly, that is one of the case.
so I also checked if recurrence or scheduler will work in those cases or not.

0 Votes 0 ·
BrunoLucas-9843 avatar image
0 Votes"
BrunoLucas-9843 answered BrunoLucas-9843 commented

Looking at that control I don't see any setting to do that . The Send-Wait-Return is built-in inside the control that does not appear to offer some option to manage multiple recipients.

What you can try to do is to add the recipient list (followed by the SharePoint) into an Array and loop. like on this video:
https://www.youtube.com/watch?v=yQqN950H-UE

Another way would be using the http control to direct access graph:
https://techcommunity.microsoft.com/t5/integrations-on-azure-blog/calling-graph-api-from-azure-logic-apps-using-delegated/ba-p/1997666
https://docs.microsoft.com/en-us/answers/questions/158736/how-to-send-an-adaptive-card-through-microsoft-gra.html

use this api to send
https://docs.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&tabs=http

than use this to check, count and return after you have all messages:
https://docs.microsoft.com/en-us/graph/api/chatmessage-list-replies?view=graph-rest-1.0&tabs=http

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

look like "Post an Adaptive Card to a Teams user and wait for a response" is now deprecated:
https://docs.microsoft.com/en-us/connectors/teams/#post-an-adaptive-card-to-a-teams-user-and-wait-for-a-response-[deprecated].
"Post adaptive card and wait for a response" field "post in" does not offer a single user option. Using that inside of a loop would pop 1 message per user in the same channel.
https://docs.microsoft.com/en-us/connectors/teams/#post-adaptive-card-and-wait-for-a-response

1 Vote 1 ·
60827847 avatar image 60827847 BrunoLucas-9843 ·

Hey Bruno,

did you mean field "post in" does only offer a single user option right?

Also, I tried previous steps as per suggestion, but those are not supporting i.e. Graph API.

I checked both the links given above, and hence the required actions are now "deprecated" , now I believe we cannot collect multiple responses with single Adaptive Card.

0 Votes 0 ·

so, long story short, there is no longer a clean way to do that using those "Team" actions. There used to be one that would create the message in a use's chat window. if you try this: https://powerusers.microsoft.com/t5/General-Power-Automate/Using-Flow-to-send-or-mention-Adaptive-card-to-multiple-users/m-p/361537#M35169 you will see that ""Post an Adaptive Card to a Teams user and wait for a response" is no longer available. What is available will post to channel or team chat. That means you would have one post card per person but all posted under the same chat window. if you want to avoid that, the only solution is using the "http" action and try to send a message to each user (to the user's own chat window) using this: https://docs.microsoft.com/en-us/graph/api/chat-post?view=graph-rest-1.0&tabs=http. That will be far more complicated but would be the only way until Microsoft bring that action control back. To Clarify, there is no "Graph Api" Action. you use the "Http" action to call the Graph API. An alternative to the "http" control is using an Azure Function

0 Votes 0 ·
Show more comments