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 Automate / Updating MS Teams adap...
Power Automate
Unanswered

Updating MS Teams adaptive cards - Message ID not found

(2) ShareShare
ReportReport
Posted on by

Ive been waiting for a while to be able to update adaptive cards in MS teams..

This is great its finally here...

Below is a very simplified method of what I would like to do...

 

1) posting a card and waiting for a response.. this has a 24 hour timeout

a) If user responds, update card and move on

b) if user doesnt respond in the 24 hours, card becomes invalid...basically going to put this in a do until loop, and once it times out it will send a new card until the user responds)

 

jimi_hendrix_0-1666234953855.png

 

Im seeing that in a standard flow.. with no response and no timeout of the adaptive card, the update works.. the update also works when user selects something. BUT when I institute a timeout of the adaptive card, and that timeout is triggered, the update card fails with the error of no Message ID. 

 

I know that this is a new option but if I were to venture a guess, this is a bug within that new Update option. 

 

Please advise, if there is a work around and acknowledge that Im not going crazy. 

 

Thanks

Categories:
I have the same question (0)
  • 996 Profile Picture
    9 on at

    @jimi_hendrix  I ran into the exact same issue just now.  I was hoping it might be possible to capture the message ID through the action Tracked Properties, but no... 

     

    996_0-1666906266840.png

     

    This is the response I received from the tracked properties....no message ID... 

    {
        "ACAction": {
            "endTime""2022-10-27T20:15:11.4078997Z",
            "code""ActionTimedOut",
            "status""TimedOut",
            "error": {
                "code""ActionTimedOut",
                "message""The workflow action 'Post_adaptive_card_and_wait_for_a_response' timed out while waiting for webhook callback."
            }
        }
    }
     
    The biggest use case of the "Update an adaptive card in a chat or channel" action would be the ability to update a timed out adaptive card message; what good is it if we cannot even extract the message ID from the timed out action??   Seems like Microsoft engineers are just releasing features before real-life scenario testing... 
  • ITguy13 Profile Picture
    4 on at

    I had the same issue, so I put a custom message ID in my adaptive card. Then I set a timeout on the Post Adaptive Card and Wait action. When the action times out, I get the list of messages from the channel and use a Apply To Each condition to loop through them.  I check the messages' Attachments|Content field for the custom message ID I put in it. If it matches, I grab the Message ID and then call the Update Adaptive Card action with using that Message ID.

  • jimi_hendrix Profile Picture
    on at

    @ITguy13 , I understand the concept you are outlining, how do you add a custom message ID to the adaptive card?

  • ITguy13 Profile Picture
    4 on at

    @jimi_hendrix, I created a custom MsgID variable by assigning the current UTC time stamp to it: 

    formatDateTime(utcNow(),'yyMMddhhmmss')

     

    Then I generated a random 4 digit number and appended it to the MsgID variable (probably a bit overkill but wanted very little chance of duplicating MsgID.

     

    I then added that variable to my Adaptive Card code in a text block at the bottom right of the card:

    {
    "type": "TextBlock",
    "text": "MsgID: @{variables('MsgID')}",
    "wrap": true,
    "horizontalAlignment": "Right",
    "fontType": "Monospace",
    "size": "Small",
    "weight": "Lighter",
    "isSubtle": true,
    "color": "Light"
    }

     

    Then I set a timeout of 2 days (P2D) on the Post an Adaptive Card in Teams and Wait action (it automatically times out after 30 days).  So, I have a set of actions that runs if the adaptive card action times out. It gets the list of messages in the Channel, then searches them for my custom MsgID text in the message attachments (where adaptive cards are located). When it finds it, it grabs the real Message ID of the message and then I use it to for an action step to Update an Adaptive Card in chat or channel with new card code.

     

    Hope this helps you! (at least until Microsoft gives us the message ID of the Post Adaptive Card and Wait action even while it's waiting. 😉)

  • bdotp Profile Picture
    4 on at

    @ITguy13 are you able to share your flow for the search and lookup section for your custom MsgID variable? I cannot get it working

  • bdotp Profile Picture
    4 on at

    If anyone is wondering, when I followed ITguy's suggestion the condition of finding the MsgID in the current iteration would never result in true.

     

    It loops through the 'Message List' (from Get messages) and then loops through the 'Message attachments'.

     

    I ended up creating a new string variable and eventually setting that variable to the current item in the 'Message attachments' loop (Apply_to_each_2 in the picture).

     

    Then I did a condition to look and see if we find the MsgID variable in this new string variable. 

    UpdateAdaptiveCardOnTimeout.PNG

     

    Then in the 'Update Adaptive an card in a chat or channel' I added 'Message id' to the Message ID field. 

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard