Assign Adaptive Card to multiple Teams users

Table of contents:

I’ve been asked that question multiple times – how to assign a single Adaptive Card to multiple Microsoft Teams users and then collect responses. The point is, that action “Post an Adaptive Card to Teams user and wait for response” lets us to collect just a single response at a time. So how can we do it?

There are two possible approaches – assign multiple cards in parallel or sequentially. Then of course wait for all responses or wait just for first. But let’s focus on two scenarios – wait for all responses in parallel and sequential order.

Sequential scenario

This scenario seems to be quite easy. We need to prepare a list of assignees, then convert it into array, finally use “Apply to each” loop on that array. In each run, use action, to send Adaptive Card to a user and wait for the response. Once the response is collected, process other steps of logic and then move to another assignee.

Parallel scenario

If number of assignees is fixed, you could try to create a fixed workflow too using parallel branches. Simply, in each branch assign card to a single user and wait for their response. Once all responses are collected, workflow will move out from parallel branch.

What I do like more however is a more generic approach. Watch the video below to understand what I mean. You can watch how I created the solution and how it works, so you can build it yourself 🙂

The main piece to understand in the more generic approach is that it uses:

  1. Child Flow to assign each individual assignee an Adaptive Card,
  2. Database to register outcomes from completed Adaptive Cards,
  3. Set of workflows that control the overall business flow

The idea is following:

  1. Main workflow prepares a list of approvers and defines Adaptive Card contents;
  2. In the loop it triggers Child Flow, passing it assignee details and Adaptive Card contents;
  3. Child Flow process input data, responds to parent flow (so that it doesn’t wait for Child to be completed), sends Adaptive Card to a user and waits for response. Once response is collected, it saves outcome in database.
  4. For each saved response another flow is triggered, that checks if all required Adaptive Cards are completed so that the process can simply end. Once that’s true, it validates if general outcome is Approved or Rejected to set workflow outcome.

Database that is used can be either CDS or CDS Lite. It can even be SharePoint. Point is, that it is needed, because the responses are collected asynchronously so there’s a need for a storage, that will keep status of how the process runs.

If you’d like to learn more about my approach please leave a comment below.

Tomasz Poszytek

Hi, I am Tomasz. I am expert in the field of process automation and business solutions' building using Power Platform. I am Microsoft MVP and Nintex vTE.

  • Kevin McCarron

    Wow Tom this is fantastic. Extremely creative and thoughtfully constructed. These posts have a tremendous amount of value!

    November 4, 2020 at 2:29 am Reply
  • Alex

    Hi Tomazh. Trying to reproduce 1st scenario with a sequential execution and faced a problem, that after posting action no output is available to process the reply from adaptive card. When i do a similar thing outside of for each loop for one post action, everything is OK.

    Can you suggent something?

    February 25, 2021 at 2:34 pm Reply
    • Tomasz Poszytek

      Yes, this is a known bug. You need to use expression to get data from the card. Simply use ‘Compose’ action and preview what body(‘Name_of_your_Adaptive_Card_action’) returns. Then simply use: body(‘Name_of_your_Adaptive_Card_action’)?[‘data’] or ‘submitActionId’ to get what you need.

      February 27, 2021 at 11:00 am Reply
  • Mohamed Sithick

    Hi Tomasz,

    I hope you doing well. I need your guidance. How to create universal actionable adaptive card for serviceNow. Please provide your step by steps guidance. i’m waiting for your reply. Thanks

    June 20, 2023 at 12:05 pm Reply
    • Tomasz Poszytek

      Hey, please send me an inquiry through the contact form, thanks!

      June 29, 2023 at 10:47 am Reply
  • Shifa Momin

    Hi All,

    I have created a flow to send adaptive cards to multiple user and wait for the response and the flow is sending cards but problem is adaptive cards are showing up sequentially. Once the first user provides their response, the Flow will continue by sending the same card to the second user, then it will wait for that user to respond, and so on.
    However if I change the concurrency control I’ll have maximum 50 parallel branches. But what should be the approach if I need to get response from more than 50 users???

    September 20, 2023 at 1:57 pm Reply
    • Tomasz Poszytek

      Hey, in this case I would rather recommend to use the simple “Post adaptive card” action, without waiting, and then to build another flow that is triggered with the “when someone responds to an adaptive card” trigger. Learn more here:

      September 28, 2023 at 7:28 pm Reply

Post a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.