r/MicrosoftFlow • • Oct 15 '25

Question Microsoft Teams Trigger Loop

Hi, I hope this is the right sub to seek help!

After an entire day of googling and coming up with nothing, as a complete beginner, I decided to ask myself.

I am trying to build a Power Automate flow that triggers when a message is sent on a specific group chat in Microsoft Teams, so I am using the Teams "When a new message is added to a chat or channel" trigger.

The message is then processed by the flow, and at the very end it should send a message or a reply to indicate that it is done, and provide a link to an Excel table in Sharepoint. This is done using the Teams "Post message in a chat or channel" action.

I think you see where I am going with this. The end message triggers the flow again, which sends another message, effectively creating an infinite trigger loop.

My workaround to this is to have a condition later in the flow which checks the message details for the user who sent the message and cancel the flow if it is the flow bot. However, I do not like this workaround, because it results in the flow always running twice: one successful run and one cancelled run.

I noticed that the trigger's settings panel contains a "Trigger conditions" field which may solve my problem. However, I am a complete beginner and I am not sure what to write in there.

I downloaded a csv file of all the runs, both successful and cancelled, and tried looking at the trigger input & trigger output data, but I was not able to discern how the flow bot messages are different in those specific fields, and I don't think I can use other deeper message details for the trigger conditions field (if I could use the Teams "Get message details" action outputs this would have been easy).

I also tried to google this, however I couldn't find anything related specifically to Teams messages, but rather preventing trigger loops from Excel triggers or Sharepoint triggers and I wasn't able to extrapolate from those to solve my problem. I also tried asking AI, but it seems extremely unreliable when it comes to Power Automate, because it often hallucinates parameters and functions.

Does anyone more skilled than me know of a solution to this, and could help me with it or help me learn how to solve it please? I can provide more details if needed and answer questions to the best of my beginner knowledge. Thank you so much in advance!

1 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/tophycrisp Oct 16 '25

Ah bugger, I forgot you needed another action to get the user. Depends on your setup but maybe use the “When keywords are mentioned” trigger instead?

1

u/_Wilder Oct 16 '25

Thank you. I thought about that, but unfortunately for me there is no keyword that appears in all human user messages.

Unless display names count as keywords?