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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get MessageID of the m...
Power Automate
Answered

Get MessageID of the message after posted in team channel

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello Team, 

 

I am using 'Post a message as the flow bot to the channel( preview)' for posting a message in a team channel and I am able to do that  but am unable to figure out on how to get the message ID of this posted message as have to store this in my local storage for future references ( i,e to find replies of the message using a message ID )

 

Any pointers are highly appreciated 

Categories:
I have the same question (0)
  • Verified answer
    Sutherland Profile Picture
    on at

    Hi Phani,

    This connector 'Post a message as the Flow bot to a channel' has no returns.
    https://docs.microsoft.com/en-us/connectors/teams/#post-a-message-as-the-flow-bot-to-a-channel
    You could utilize get messages under above action to parse Odata message or just use ‘Post a message (V3)’ as workaround.
    https://docs.microsoft.com/en-us/connectors/teams/#getmessagesfromchannel_response
    https://docs.microsoft.com/en-us/connectors/teams/#post-a-message-(v3)-(preview) 

  • Verified answer
    fchopo Profile Picture
    8,003 Moderator on at

    Hello @Phani 

    You could use the following expression in a compose action to get the message id:

    outputs('PostMessage')?['body/id']

    Have a look at this example (I'v renamed the Post message to as the flow bot ..." to "PostMessage" for simplicity).

    postMessage.png

     

    Hope it helps!

    Ferran

  • xpl0sion Profile Picture
    7 on at

    Hi @Phani,

    The answer from @fchopo is working but I used a very short way to get the Teams message ID I want to reply to:
    In Teams-channel use the 3-dot-menu (...) on the message you want to use in the workflow and select copy link. Then open a program to paste the copied link (i.e. notepad). When the copied link was pasted there, the message ID is in the link:

     

     

    https://teams.microsoft.com/l/message/ ...bla... ?tenantId=... &groupId=...&parentMessageId=... &teamName=... &channelName=... &createdTime=... &allowXTenantAccess=true/false

     

    The data between "parentMessageId=" and "&teamName=" is the message ID to be used in the workflow of Power Automate.

    I have testet it and it works with replies and adaptive cards.

     

    good luck and have fun!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard