Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Template
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

How to avoid creation of duplicate Planner task with Power Automate

Posted on May 16, 2021January 6, 2022 by Tom

“I created a Power Automate flow to add a new task in MS Planner whenever an email is received, however, flow is creating duplicate tasks when a response/reply is received to the same email: I would like to avoid that.”


If you use flow to create tasks from incoming emails, you probably don’t want a new task for every email. The flow should create a task only from the original email, not from each reply to that email.

But how do you tell the flow to create just a single task, without duplicates? How does it recognize when it’s a new email and when it’s a reply?

Check if task already exists

The first thing to check is if the Planner task already exists. ‘List tasks’ to get all existing tasks, and then ‘Filter array’ to filter tasks by their title. Power Automate doesn’t offer any direct tasks filter, that’s why you need two actions (unlike e.g. with SharePoint items).

Let us assume that the tasks use the email subject as their title, therefore, Title is equal to Subject.

Once you filter the tasks, you should add a ‘Condition’ to check if the filtered array is empty. Empty output from ‘Filter array’ means there isn’t any task with the title and you should add it. If it’s not empty, the task already exists and you don’t have to do anything.

You can use the length(…) expression to check if the output length (number of tasks) is greater than 0.

length(body('Filter_array'))
power automate avoid planner task duplicate

Don’t create a task for reply email

It gets a bit complicated with reply emails. The process above will find only exact match between the task title and the email subject. But reply emails don’t have the same subject, they’ve got ‘RE:’ or ‘Re:’ as the subject prefix. And since you don’t want ‘Task’ and ‘Re: Task’ in your tasks list, you must handle also the replies.

Add another ‘Condition’ into the ‘is empty’ branch to check if the subject starts with RE: or Re:. If it does, don’t create a new task, it’s a reply to another email. If it doesn’t, create the task.

power automate avoid planner task duplicate email response

Note: the reply prefix depends on your regional / language settings, adjust it accordingly.

Summary

Following the approach above you can avoid creation of duplicate Planner task in any Power Automate flow. In this post it was using incoming emails for the tasks, but it’ll work with any source or a template.

It’ll be actually easier with other sources. Without the replies you can rely on the unique task title and stop with the first ‘Condition’.


πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

11 thoughts on “How to avoid creation of duplicate Planner task with Power Automate”

  1. Caroline Garcia says:
    October 12, 2021 at 10:07 pm

    Hi! How can I avoid duplicate planner tasks when creating tasks from a SharePoint list?

    Reply
    1. Tom says:
      October 16, 2021 at 9:14 pm

      Hello Caroline,
      you can check it using the same approach: before you create a task, check if a task with the desired title already exists. Instead of email ‘Subject’ use the task title from SharePoint.

      Reply
  2. Wora says:
    January 19, 2022 at 3:43 am

    Hi, I have a few questions.

    In the step “Check if task already exists” in Filter Array, I cannot find Value title. There are only Value Name, Value plan id, Value id, value item, body, value.
    How can I find Value title?

    Reply
    1. Tom says:
      January 23, 2022 at 5:45 pm

      Hello Wora,
      I checked it and I always see all the available dynamic contents as in the article. Are you using the right action? Did you try using the value Name?

      Reply
  3. jo says:
    May 2, 2022 at 12:25 pm

    Hi Tom,

    I’m looking to avoid duplication based off of parent message ID(Get message details/body/replytoID) placed in the description field of a task rather than searching the title. Is this possible with a filter array for list tasks? if there is I’m not seeing it.

    people in my organization tend to follow a format; Often the trigger I have catches their keyword text, and creates the title with the text, but since it can be non-unique this may cause it to skip task creation. I could just use the parent message ID as the title, but some people are picky about change.

    Reply
    1. jo says:
      May 2, 2022 at 12:56 pm

      Actually, what I may end up doing is making the title look like a ticket and filtering the array to [title] Contains [Parent ID]. Since they don’t necessarily need to know what the numbers at the front of the task mean.

      Any other elegant solutions you can think of?

      Reply
      1. Tom says:
        May 3, 2022 at 8:30 pm

        Hello jo,
        adding id in the task title is the best solution, I just checked the outputs from ‘List tasks’ and that’s the only property in there whose value you can control.

        Reply
  4. Jes says:
    August 5, 2022 at 11:02 am

    Your post was SOOOO helpful, thank you so much!
    I’ve found a better way to avoid duplicates, and be able to add content before the subject (like a emoji if an email has been received or so…)
    In the filter aray instead of using “is equal to” change it to “ends with”. This will help with RE: and re: plus will allow you to customize the tasks as long as the end remains unchanged.

    Thanks again for the post!

    Reply
  5. Marcelo says:
    April 14, 2024 at 4:15 pm

    This post was really helpful, I just have one detail since I use this flow for handover from weekday’s shifts to weekend’s shifts.
    The second condition does avoid to duplicate the task if there is a prefix “RE:” on the subject, but let’s say that the first email that will add the task already comes with the prefix “RE:”?. In this case that second condition will prevent the task to be created even if the task wasn’t in the list already. I tried by changing the “equal to” for ” ends with” in the array function , but it didn’t work.
    note: some emails already come with the “RE:” prefix because the task is created till one specific person is added to the email.
    any tip You could give me please?

    Reply
    1. Tom says:
      May 25, 2024 at 9:24 pm

      Hello Marcelo,
      it’s not a perfect solution, I agree that multiple RE: are a problem, but I don’t know how to deal with that.

      Reply
  6. Gareth Reeves says:
    May 17, 2024 at 3:19 pm

    I have tried this but for every existing planner tasks name that does not match the email subject it creates a new task. so 400 existing task all not with a name that matches the email creates 400 new tasks with the name of the email! where have i gone wrong?

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Still exchanging emails to get things approved?

Get the Approval Process solution and the Task Delegation App to skip the hard part and deploy an automated, fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundleβ€”everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes