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 / How to get and send a ...
Power Automate
Unanswered

How to get and send a reply within same message ?

(0) ShareShare
ReportReport
Posted on by 2

I have channel and I want to get the last message and reply with the info, how do I do this ?

I tried using "get message details" seems like it is not working.

 

jalaludin_0-1712205556946.png

For example, the last message is "wdadw", I want to get that message and add my reply to it. So my message will be "wdadw myMessage".

 

Can I get advise as well on how to get the message id ?
Please refer my test workflow below.

jalaludin_2-1712205706306.png

 

Categories:
I have the same question (0)
  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @jalaludin 

    The "Message Id " can get from the trigger "When a new channel message is added":

    vyueyunmsft_0-1712209047611.png

     

     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

     

     

  • jalaludin Profile Picture
    2 on at

    Hi  , 

    Thank you for the fast reply. I think you misunderstood.

     

    I do not want auto reply based on new message posted.

    I actually want, to get the message from a specific post in a channel.

     

    What I actually want to do is to make an automation that: -

    1. Get the last message in that post (does not matter if it was 10days ago)

    2. Use the get information into a new reply

    3. Send the reply

     

    For example: 

    1. The last message from the announcement shown in image above is "

    Hye, this is Message1.

     

    Hye, this is Message2.

    "

    2. I want to get that message information

    3. And reply with 

    "

    Hye, this is Message1. 

     

    Hye, this is Message2.

     

    Hye, this is Message3. 

    "

    the message1 and 2 is from the get message flow.

     

    How can I achieve this ? 

    I would be very grateful for your help.

    jalaludin_0-1712210492762.png

    @v-yueyun-msft

  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi, @jalaludin 

    Do you mean you want to get the last Message id ?

     If this , you can try this:

    vyueyunmsft_0-1712212354584.png

    Then use this expression:
    outputs('Get_messages')?['body']?['value']?[0]?['id']

     

    And if you want to get the replies message , you may need to call the Garph API:
    Solved: Get Teams messages and its replies - Power Platform Community (microsoft.com)

     

    Best Regards,

    Yueyun Zhang

  • Perumal Profile Picture
    604 on at

    Use an action 'Get messages' to retrieve all the messages from the specific channel. To obtain the last message from that channel, 

    utilize the expression 

    substring(body('Get_messages')?['value'][0]?['body']?['content'], 3, sub(length(body('Get_messages')?['value'][0]?['body']?['content']), 7)) 

     

    Additionally, add an action 'Reply with a message in a channel' and utilize the expression to obtain the message ID of the last updated message in the channel.

     body('Get_messages')?['value'][0]?['id'] 

    Perumal_0-1712212443149.jpeg

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!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 251 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 239

#3
Expiscornovus Profile Picture

Expiscornovus 220 Most Valuable Professional

Last 30 days Overall leaderboard