Search code examples
botframeworkmicrosoft-teamspowerappsadaptive-cardspower-automate

Using MS Teams, Power Automate and Adaptive Cards: how to use inputs from user using the Flow Bot to use in another Adaptive Card


I'm trying out Powerapps and would like to try out this low code approach.

The idea is as follows:

  1. Display an Adaptive Card (going to use the sample one) to the user using Microsoft Flow/Power Automate application within Teams.
  2. The user would then input some information on the card and submit it
  3. Use that input that was submitted to populate another Adaptive Card.

To illustrate the above, in Power Automate: Shows the three steps as explained above

Here is how the output is displayed when used in the Schema Explorer for Action.Submit: I would like to get the output like it's displayed in the popup, for input on another Adaptive Card in Teams to be posted by the Flow bot

In Microsoft Teams, the Flow bot will display the ticket to the user to be filled in: enter image description here

How can I get the values from the inputs and reuse them in Power Automate. Does anyone know how to get those values and reuse in the next step (see first image) ?

Thank you in advance for your assistance. Would appreciate any help.


Solution

  • Basically, the problem is that the "submit" action of the Adaptive Card returns the response to the original source, in this case the "Flow Bot". However, Flow Bot is a general bot, and doesn't have a way to route the response back to your individual Flow, and specifically to the instance of the Flow. Thankfully, this is changing - see here for information. It's not clear from the post whether it will handle the "Bot-to-user" scenario in version 1 though, which I see you use in your solution, and also, as stated in the blog, it's only expected in Feb. So, it would seem there are two options:

    1. Wait till Feb for the new feature
    2. Create your own Bot to send the cards from, and handle the responses - there are a few small tricky parts here as you need to send the initial message on a schedule, so you'd be using something called "pro-active messaging", but it's not too complex and something there's good guidance on here in Stack Overflow (I've myself answered a few questions recently on it so can help more if you go this route)

    Not an ideal answer I'm sure you were looking for, but hopefully it helped