Skip to main content

Notifications

Community site session details

Community site session details

Session Id : K3Cj98DioyOLBYIVA5YaME
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!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,700 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard
Loading started