Skip to main content

Notifications

Community site session details
Power Automate - Building Flows
Answered

Get MessageID of the message after posted in team channel

Like (1) ShareShare
ReportReport
Posted on 13 Dec 2020 02:38:18 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 

  • xpl0sion Profile Picture
    7 on 26 Jan 2023 at 08:21:06
    Re: Get MessageID of the message after posted in team channel

    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!

  • Verified answer
    fchopo Profile Picture
    7,968 Super User 2025 Season 1 on 13 Dec 2020 at 10:05:22
    Re: Get MessageID of the message after posted in team channel

    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

  • Verified answer
    Sutherland Profile Picture
    on 13 Dec 2020 at 10:01:19
    Re: Get MessageID of the message after posted in team channel

    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) 

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 97

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 70 Super User 2025 Season 1

#3
David_MA Profile Picture

David_MA 48 Super User 2025 Season 1

Overall leaderboard
Loading started
Loading started