cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
amoss98
New Member

Trigger 'When a new channel message is added' triggering on old messages

Hello Power Automate community,

 

I have recently been testing out Power Automate a bit and I set up a simple flow to DM a user in Teams if a new message is posted in a certain channel. I am using the Teams trigger 'When a new channel message is added.' I had turned this flow off for a few months as we stopped the process that had created a need for this flow. Recently, however, I turned this flow back on and I am seeing that it is triggering on old messages.

 

For example, when I look at a run, the message time is very old:

 

 

{
  "@odata.type": "#microsoft.graph.chatMessage",
  "etag": "1608230834380",
  "messageType": "message",
  "createdDateTime": "2020-12-17T18:47:14.38Z",
  "lastModifiedDateTime": "2020-12-17T18:47:14.38Z",
  "summary": "<summary would be here>",
  "importance": "normal",
  "locale": "en-us",
  "webUrl": "https://teams.microsoft.com/l/message
}

 

Has anyone else experienced this? I've had to turn this flow back off because it kept triggering on old messages in seemingly random fashion.

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @amoss98 :

The point is that 'When a new channel message is added' is a polling trigger.

vbofengmsft_0-1625105972513.png

When the flow is turned on again, all unprocessed/pending events are processed. Delete, and then recreate your flow if you don't want to process pending items when you turn your flow back on.

I think this link will help you a lot:

My trigger is firing for old events

Best Regards,

Bof

View solution in original post

3 REPLIES 3
v-bofeng-msft
Community Support
Community Support

Hi @amoss98 :

The point is that 'When a new channel message is added' is a polling trigger.

vbofengmsft_0-1625105972513.png

When the flow is turned on again, all unprocessed/pending events are processed. Delete, and then recreate your flow if you don't want to process pending items when you turn your flow back on.

I think this link will help you a lot:

My trigger is firing for old events

Best Regards,

Bof

View solution in original post

amoss98
New Member

Thank you, @v-bofeng-msft
 
I think that was the answer I needed.

 

Thanks - that's a very helpful answer to a not very helpful design!

 

The linked article doesn't seem to indicate how you can determine what timestamp it is using as a basis for its checks. That must be stored somewhere in PowerAutomate, but I don't know if it's something I can access. I've exported the flow, but it's not clear if it's anywhere in there.

 

The article says "Delete, and then recreate your flow if you don't want to process pending items when you turn your flow back on.", but it isn't clear if it's sufficient to make a copy of the flow and then delete the original. That is certainly several orders of magnitude easier than manually creating a complicated flow from scratch if it works.

 

Overall I'm surprised it operates this way without any option of "resetting the clock" when a flow is switched back on. Perhaps one for a feature request...

 

Update: It seems that it is sufficient to save a copy of the flow with a different name via Save As, then delete the original. Whatever state is held in Power Automate to track where the polling trigger has reached must not be retained when the flow is saved under a new name.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (935)