top of page

How to find a Teams channel message with Power Automate

  • Writer: Matthias Schmitz
    Matthias Schmitz
  • Aug 14
  • 1 min read

In a recent project I had the need to find a specific message in a Teams channel which was one of many replies to the initial channel message.


I could not find an article about this online, so here we go!


To demonstrate this, I chatted a little with myself and sent channel replies back and forth:

ree

In this example the Request number was sent as a channel message and we need this in a flow.


And yes, I know, the example is not the best but it will be helpful nevertheless :)


To achieve this we can do the following:


  1. We list all the replies of this specific channel message. For this you need the team, the channel and the parent message ID. You either get this dynamically or if you want to test it out, you can copy the link of the main message and check the URL for "parentMessageId".

    ree

  2. Filter the array of messages

  3. Remove the HTML tags to get plain text. I used the first() function, otherwise you get a for each loop around the Html to text action: first(outputs('Filter_array')['body'])?['body']?['content'] - more about this here: https://www.matthiasschmitz.com/post/how-to-get-one-record-using-first-instead-of-using-apply-to-each-in-power-automate



ree

That's it. Pretty simple in the end!

Comments


bottom of page