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

Avoid duplicates re: Flow connecting events in Outlook Calendar to Planner

I built a flow to populate calendar events from outlook into planner when there is certain defined text contained within the subject line, however I cannot seem to find a way to stop it from creating a new "task" in planner when the task already exists (i.e duplicates). Is there a way I can define a condition or an action to look for the title of the task in planner and if it already exists not to create a new one?

 

I'll attach a screenshot of the existing flow.

Any help would be much appreciated - I am new to this! Thank you!
Existing Flow outlook -> plannerExisting Flow outlook -> planner

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Avoid duplicates re: Flow connecting events in Outlook Calendar to Planner

Hi @SRIntelex,

 

I agree with @SRIntelex's thought almost. I have made a test on my side and please take a try with the following workaround:

  • Add a "When an event is added, updated or deleted" trigger, specify Calendar id.
  • Add a Condition, left input box set to Subject dynamic content of the trigger, right input box set to Intelex Training, Within middle drop down, choose contains.
  • Within "If/yes" branch of Condition, add a "List tasks" action (rather than the "List my tasks"), specify Plan Id. Then add a "Filter array" action, From set to output of "List tasks" action, within condition box, left input box set to Title dynamic content of the "List tasks" action, right input box set to Subject dynamic content of the trigger, middle drop down, choose is equal to.

         Add a Condition 2, click "Edit in advanced mode", type the following formula:

@empty(body('Filter_array'))

Within "If/yes" branch of Condition 2, add a "Create a task" action, Title field set to Subject dynamic content of the trigger. Within "If/no" branch of Condition 2, add a "Apply to each" action, input parameter set to output of "Filter array" action. Within "Apply to each" action, add a "Update item" action, Task id field set to following formula:

item()?['id']

Note: Please add the "List tasks" action to retrieve all tasks in your Planner plan within your flow rather than the "List my tasks" action.

 

Image reference:10.JPG

 

11.JPG

The flow works successfully as below:

When there is no Task alreadly exists:12.JPG

When the task already exists:13.JPG

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
New Member

Re: Avoid duplicates re: Flow connecting events in Outlook Calendar to Planner

@v-xida-msft

 

I've managed to enter everything you've suggested aside from everything in the "If No" for condition 2. How to I get the "apply to all" action to appear? When I add an action, "apply to all" isn't listed as an option.

Thank you so much!

I'll update this if I figure it out. Cheers.
Sara

 

Update: I was able to find the "apply to each" for the "if/no" but when I tested the flow it appears to have populated many instances of the test. What I'm noticing is that after selecting "Action > List Tasks" it automatically populated an "apply to each" consideration before the "filter array" which I'm not seeing in yours. How do I prevent that from happening? I think that's why it's creating multiples in mine and not yours. But, I could be wrong. 
Thanks again.

 

Update 2: It works!! Thank you.

View solution in original post

4 REPLIES 4
Highlighted
Power Participant
Power Participant

Re: Avoid duplicates re: Flow connecting events in Outlook Calendar to Planner

Hello @SRIntelex,

First of all you should decide what is the unique item that is used to decide if there is already task in Planner created.

 

For example if it is Subject - in your case Title of Planner task, then you can simply list all tasks (Action - "List tasks") that are already in specific plan where you are creating tasks. Then you will add condition that will compare Subject against Title for all tasks that you listed. And if there is positive match then no new task will be created.

 

Do you get what I'm trying to suggest?

P.

Highlighted
New Member

Re: Avoid duplicates re: Flow connecting events in Outlook Calendar to Planner

@vecerpa

Thank you for this response. I understand it in theory... just don't know what to do in terms of adding this to the flow. You are correct, it would be based on subject. How to I apply this suggestion? thank you so much!

 

EDIT: I don't want everything to pull from the calendar. Only those with "Intelex Training" in the title, which the current flow is achieving. However, opening the calendar meeting again causes the same task to populate into planner. How do I get it to adhere to the first condition (subject contains intelex training) and have it only create the task in planner if it hasn't already been created. 
I played around trying my best to incorporate the suggested advice but it's either throwing me errors or not preventing duplicates.

Thank you.

 

Here is a screenshot of what I attempted, however it actually just causes the event to be created everything an existing task title does not match the subject of the calendar event... so actually the opposite of what I'm trying to achieve. 

OutlookPlannerFlow2.png

Highlighted
Community Support
Community Support

Re: Avoid duplicates re: Flow connecting events in Outlook Calendar to Planner

Hi @SRIntelex,

 

I agree with @SRIntelex's thought almost. I have made a test on my side and please take a try with the following workaround:

  • Add a "When an event is added, updated or deleted" trigger, specify Calendar id.
  • Add a Condition, left input box set to Subject dynamic content of the trigger, right input box set to Intelex Training, Within middle drop down, choose contains.
  • Within "If/yes" branch of Condition, add a "List tasks" action (rather than the "List my tasks"), specify Plan Id. Then add a "Filter array" action, From set to output of "List tasks" action, within condition box, left input box set to Title dynamic content of the "List tasks" action, right input box set to Subject dynamic content of the trigger, middle drop down, choose is equal to.

         Add a Condition 2, click "Edit in advanced mode", type the following formula:

@empty(body('Filter_array'))

Within "If/yes" branch of Condition 2, add a "Create a task" action, Title field set to Subject dynamic content of the trigger. Within "If/no" branch of Condition 2, add a "Apply to each" action, input parameter set to output of "Filter array" action. Within "Apply to each" action, add a "Update item" action, Task id field set to following formula:

item()?['id']

Note: Please add the "List tasks" action to retrieve all tasks in your Planner plan within your flow rather than the "List my tasks" action.

 

Image reference:10.JPG

 

11.JPG

The flow works successfully as below:

When there is no Task alreadly exists:12.JPG

When the task already exists:13.JPG

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
New Member

Re: Avoid duplicates re: Flow connecting events in Outlook Calendar to Planner

@v-xida-msft

 

I've managed to enter everything you've suggested aside from everything in the "If No" for condition 2. How to I get the "apply to all" action to appear? When I add an action, "apply to all" isn't listed as an option.

Thank you so much!

I'll update this if I figure it out. Cheers.
Sara

 

Update: I was able to find the "apply to each" for the "if/no" but when I tested the flow it appears to have populated many instances of the test. What I'm noticing is that after selecting "Action > List Tasks" it automatically populated an "apply to each" consideration before the "filter array" which I'm not seeing in yours. How do I prevent that from happening? I think that's why it's creating multiples in mine and not yours. But, I could be wrong. 
Thanks again.

 

Update 2: It works!! Thank you.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (7,126)