web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Send an Adaptive Card ...
Power Apps
Answered

Send an Adaptive Card to Teams

(2) ShareShare
ReportReport
Posted on by 262
Hi All,
 
I am looking to post an Adaptive card to a User directly from Powerapps.  I have included the Teams connector in my app and there is an option PostCardtoConversation.   I have found the below syntax:
Which gives me what I need, but I am unsure as to what format the JSON needs to be in the DynamicPostCardRequest.  Any help would be appreciated.
 
 
Categories:
I have the same question (0)
  • Suggested answer
    miztrz Profile Picture
    4 on at

    Hi! You can design your card using the Adaptive Cards Designer.

    • Extract the JSON payload and format it as a string in Power Apps. For example:
    AdaptiveCardText = "{ 
     \"type\": \"AdaptiveCard\",
     \"$schema\": \"http://adaptivecards.io/schemas/adaptive-card.json\",
     \"version\": \"1.3\",
     \"body\": [
       {
         \"type\": \"TextBlock\",
         \"text\": \"Hello, User!\",
         \"wrap\": true,
         \"size\": \"Large\",
         \"weight\": \"Bolder\"
       }
     ]
    }"
    • Use the PostCardToConversation function in your app, combining the recipient details and the Adaptive Card payload, like the below example:
    MicrosoftTeams.PostCardToConversation(
     "Flow bot",
     "Chat",
     ParseJSON(
       JSON(
         {
           recipient: {
             userId: "your-user-id", // Replace with the user's actual ID
             tenantId: "your-tenant-id" // Replace with your tenant ID
           },
           messageBody: AdaptiveCardText // Reference to your Adaptive Card JSON string
         },
         JSONFormat.Compact
       )
     )
    )
    • Replace "your-user-id" and "your-tenant-id" with the actual values

    Check out this blog for more details! Let me know if that answers your question. :)

  • Skybluekid Profile Picture
    262 on at
    Hi miztrz,
     
    Thank you for the reply. We applying I am getting the error as shown:
    any ideas?
     
  • Verified answer
    Skybluekid Profile Picture
    262 on at
    I have figured the solution, as below:
     
    UpdateContext(varChat:
                          MicrosoftTeams.CreateChat("[Email Address",{topic:""})});
    UpdateContext({Object:{
        type: "AdaptiveCard",
        version: "1.5",
        body: [
            {
                type: "TextBlock",
                text: "Hello User!",
                wrap: true
            }
        ]
    };
    UpdateContext({Object2:JSON(Object)});
     
    MicrosoftTeams.PostCardToConversation(
        "User",
        "Group Chat",
        ParseJSON(
            JSON(
                {recipient : varChat.id,
                messageBody: Object2},JSONFormat.Compact)))
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 762

#2
11manish Profile Picture

11manish 640

#3
Valantis Profile Picture

Valantis 548

Last 30 days Overall leaderboard