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 / Duplicate Creation of ...
Power Automate
Suggested Answer

Duplicate Creation of Tasks in Planner using "When an Email Is Flagged"

(0) ShareShare
ReportReport
Posted on by 22
Hi team,
 
I have previously created a flow that Creates a Planner Task when an email is Flagged. Recently the flow has started to create duplicate (3) tasks for the same email. I have tried recreating the entire. I rely on this flow and if i can't get fixed i will need look for alternatives. There are no errors being reported however i can see that the flow did run three times at the same time. The flow is attached below. Any guidance would be appreciated. 
Categories:
I have the same question (0)
  • Tomac Profile Picture
    4,046 Moderator on at
     
    To prevent multiple flagging events from triggering your flow multiple times, you will want to have a tacker function.
     
    In SharePoint, create a List with a text field for MessageID. You can even use the built-in Title field for this if you want. I'll refer to it as MessageID for clarity.
    In your flow, add a Get Items at the top targeting your new list, with an ODATA filter: 
    MessageID eq '[dynamic content from your trigger for the message ID]'
    Next, add a Condition and have the left side be:
    length(outputs('Get_items')?['body/value'])
    The middle should be Greater Than and the right size the number zero
    In the If Yes side, add a Terminate action and set it to Cancelled
    In the If No side, add a Create Item action targeting your new list and add the Message ID from the trigger's dynamic content to the list.
     
    This will, when your flow runs, check your new SharePoint List to see if the flow has already been run on this email. If it has, it will cancel the flow and stop processing. If it doesn't find a match, it will create an entry for this email and then keep running, creating the task.
     
    With this simple tracker system you shouldn't get duplicate tasks from multiple triggers on the same email. You may want to go into your trigger's settings and set Concurrency Control to 1 just to be double sure.
     
    Here's how this setup looks when built:
     
    If this comment resolved your issue, please remember to mark it as the answer.
  • GeorgeKh Profile Picture
    22 on at
    Hi @Tomac,
     
    Please see my workflow below: It has not fixed the issue, i am now getting 3 or more duplicate tasks created:

  • Tomac Profile Picture
    4,046 Moderator on at
    @GeorgeKh Can you please verify if the rows are being added to the SharePoint List as expected, and whether you've set the trigger's Concurrency to 1?
  • Suggested answer
    AndrianaO Profile Picture
    213 Moderator on at
    Hi @GeorgeKh !  
     
    Unfortunately, this is a known limitation of the "When an email is flagged" trigger. And actually, there is more to be afraid of about that trigger. If you move your email, reply to it or modify it in any way, there is a high chance that the flow will be triggered again. You can read more about the limitations here https://learn.microsoft.com/en-us/connectors/office365/#known-issues-and-limitations-with-triggers
     
    The idea that @Tomac suggested is the only way to handle it - you have to track the emails that were already processed by the flow to prevent duplicate tasks from being created. There are a couple of things I'd add to that idea to make it work:
     
    1. MessageId is not as unique as one might think. If you move your email from one folder to another, the MessageID is going to change, so the flow will be triggered again, even with the tracking system in place. Instead, you can use a property called Internet Message ID. This remains unique all the time, and even if you create a copy of that email, the copy will have the same Internet Message ID -> ultimate duplicate prevention. 
     
    2. If two flows run simultaneously, there is a high chance of a situation where flow 1 checks the uniqueness of the ID and doesn't find it in the list, but flow 2 creates a record right after that, so flow 1 will create a record too. What I'd do instead is enforce the uniqueness of the column on the SharePoint side. To do so, go to your SharePoint list and create a text column called "EmailID" or something like that and in More Options select "Enforce unique values". Do not use the Title column; you cannot enforce unique values on it.  
     
    After that, I'd build a flow as follows: 
     
    Compose action is a placeholder for whatever logic you're about to build if the ID is unique. It is in the parallel branch with the Terminate action. Terminate action is configured to run only if the Create an item action has failed (which we want to happen if it is a duplicate run and we enforced uniqueness of the EmailID column for this exact purpose). Make sure to configure that and set the status to Succeeded if you want to keep everything clean, and you don't want to see a bunch of failed runs in the flow run history. 
     
     
    It worked like a charm on my side, so please let me know if it works for you too!
     

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 262 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 227

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard