How to get output from a Teams Adaptive card with Power Automate

3 min read 1 year ago
Published on Aug 08, 2024 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

In this tutorial, you will learn how to use Microsoft Teams Adaptive Cards with Power Automate to collect and process information efficiently. This guide will walk you through the steps of designing an Adaptive Card, integrating it into a Power Automate flow, and managing responses. By the end, you'll be able to create interactive cards that enhance user engagement and streamline data collection.

Step 1: Create an Adaptive Card

  1. Access Adaptive Cards Designer

  2. Choose the Right Settings

    • Select Microsoft Teams as your target application.
    • Set the theme according to your preferences.
    • Ensure that you are using version v1.4 or newer.
  3. Design Your Card

    • Add elements to your card such as text inputs, buttons, and images based on the information you want to collect or present.
    • Customize the layout and content of your card to meet your requirements.
  4. Copy the JSON Payload

    • Once your card design is complete, click on the Card Payload tab.
    • Copy the generated JSON code for use in Power Automate.

Step 2: Set Up Power Automate Flow

  1. Access Power Automate

    • Log in to your Power Automate account.
  2. Create a New Flow

    • Click on Create and choose Automated Cloud Flow.
  3. Select a Trigger

    • Choose a suitable trigger for your flow, such as When a new item is created or When a button is pressed.
  4. Add Action to Post the Adaptive Card

    • Add a new step and select Post an Adaptive Card to a Teams channel.
    • Paste your copied JSON payload into the Message field.
  5. Collect and Store Response

    • Add another step to handle responses from the card.
    • Use the Parse JSON action to extract data from the card response.
    • Define the schema based on the input fields in your Adaptive Card.
  6. Store the Data

    • Choose an appropriate method to store the data, such as in SharePoint or a database.
    • Add actions to save the parsed data.

Step 3: Send Confirmation via Teams Chat

  1. Add a Confirmation Action

    • After storing the response, add another action to send a message in Teams.
    • Customize the message to confirm that the response has been received successfully.
  2. Test Your Flow

    • Save your flow and perform a test by triggering it.
    • Verify that the Adaptive Card is posted in Teams and that the responses are collected and stored correctly.

Conclusion

By following these steps, you have successfully created an Adaptive Card and integrated it with Power Automate to collect responses. This capability not only enhances user interaction but also automates data management. You can explore further by customizing your cards with different inputs or by expanding your Power Automate flows to include more complex logic. Consider checking additional resources and documentation provided in the introduction for more advanced functionalities.