Send an Adaptive Card to Teams from Microsoft Lists using Power Automate

In my previous blog post I showed how to Send reminders to Teams from Microsoft Lists using Power Automate. In this post we will extend the Flow functionality to include an Adaptive Card based on our Issue Tracker List data. Please see my previous post for the steps required to complete this build.

I’m using the Adaptive Cards Restaurant sample for my starting point for its simplicity of design. While in the designer be sure to set the Host app to “Microsoft Teams”.

Set host app to Microsoft Teams

I have removed the elements that I do not require.

Sample card
Before
Updated sample card
After

Click “Copy card payload”.

Copy card payload

Edit your Issue tracker – Daily (Teams) Flow in Power Automate and add a new Microsoft Teams Post adaptive card in a chat or channel action and set:

  • Post as to “Flow bot”
  • Post in to “Chat with Flow bot”
  • Recipient to “Person or group the issue is assigned to Email”
  • Paste in the copied card payload to Adaptive Card
Post adaptive card in chat or channel

Now for the tricky part. You need to manually edit the card payload text to suite your needs and leverage the dynamic data that we pulled in from the Issue Tracker list. This should be an iterative approach where you test every change along the way. JSON is not my forte so I need to go slow and ensure that any of my changes don’t break the card. My completed card payload is listed below.

{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.2",
    "body": [
        {
            "speak": "Issue tracker reminder",
            "type": "ColumnSet",
            "columns": [
                {
                    "type": "Column",
                    "width": 2,
                    "items": [
                        {
                            "type": "TextBlock",
                            "wrap": true,
                            "text": "Issue tracker reminder:"
                        },
                        {
                            "type": "TextBlock",
                            "text": "@{items('Apply_to_each_-_Reminder')?['Title']}",
                            "weight": "Bolder",
                            "size": "ExtraLarge",
                            "spacing": "None",
                            "wrap": true
                        },
                        {
                            "type": "TextBlock",
                            "text": "Due in @{variables('varNumDays')} days.",
                            "size": "Small",
                            "spacing": "None",
                            "wrap": true
                        },
                        {
                            "type": "TextBlock",
                            "text": "@{items('Apply_to_each_-_Reminder')?['Description']}",
                            "size": "Small",
                            "wrap": true,
                            "maxLines": 3
                        }
                    ]
                }
            ]
        }
    ],
    "actions": [
        {
            "type": "Action.OpenUrl",
            "title": "More Info",
            "url": "@{items('Apply_to_each_-_Reminder')?['{Link}']}"
        }
    ]
}

Customized adaptive card payload.

My completed Flow looks like the image below. The Post a message in a chat or channel action is redundant but I am keeping it in the Flow to illustrate the different user experience between a chat message and adaptive card.

My completed Flow

Save and test your Flow. Assuming you have an issue due in 30 days you will get the following adaptive card in Teams from Flow Bot:

My adaptive card test result

The user experience with an adaptive card is far superior to a chat message. The card layout lends itself to quickly delivering and consuming information. Buttons and other “calls to action” can be added extending the functionality of the reminder and goes a long way in adding value to the experience.

Thanks for reading!

NY

6 thoughts on “Send an Adaptive Card to Teams from Microsoft Lists using Power Automate

    1. Hi Andy,

      Challenge accepted! I’ll try Calendar Reminder out in the context of this blog post and will share back the results.

      Thanks for reading!

      NY

      Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s