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

When a SharePoint item is updated to a specific type delete the task in Planner.

G'day, I need a flow that when an item is updated in SharePoint it deletes the task in planner.

 

I have a flow which runs every time an item is created inside of SharePoint which creates a task inside of planner.

SharePoint Created Flow to Planner.PNG 

 

Planner.PNG

In SharePoint when the progress column is changed to completed I need a flow that will delete the task inside of planner.

 

SharePoint list ItemSharePoint list Item

Both the SharePoint list and Planner will have multiple records inside of it so I need a flow which only deletes the specific task that is being edited. Can flow do this and if so how?

 

Thanks for your time and consideration 

 

Campbell

1 ACCEPTED SOLUTION

Accepted Solutions
DamoBird365
Super User
Super User

Hi @Campbell 

 

If you can store the Task ID back to the original list item in the first flow, you can then have a new flow that when an item is modified and the ToDo is set to completed you can pass the Task ID back to the Delete a Task Step.

 

DamoBird365_0-1614671364893.png

 

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

View solution in original post

7 REPLIES 7
DamoBird365
Super User
Super User

Hi @Campbell 

 

If you can store the Task ID back to the original list item in the first flow, you can then have a new flow that when an item is modified and the ToDo is set to completed you can pass the Task ID back to the Delete a Task Step.

 

DamoBird365_0-1614671364893.png

 

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

View solution in original post

gabibalaban
Super User
Super User

Hi @Campbell ,

Yes, it is achievable, but you need to store the Id of the new created task.

For that you need a new column in your list (TaskID) .

Then in first flow, after Planner - Create a Task action, update the column TaskId of the item with the ID of the new created task.

gabibalaban_0-1614671575435.png

 

 

The second flow should have a trigger SharePoint - When an item is created or modified with a trigger condition similar to (I can't see the status column name):

@equals(triggerOutputs()?['StatusColumn'],'Completed') 

and in the flow use the column TaskID value inside a Planner - Delete a task action. 

 

Give it a try ! Hope it helps ! 

Thanks for your time @gabibalaban.

 

I have added the ID and it is all working but I am still having trouble when the flow should and should not trigger. The trigger condition formula doesn't work as intended, I tried it as an expression but it was invalid and using it in the condition doesn't work either.

I have confirmed that the taskID works so thank you for that idea but I'm stuck with condition.

New Flow.PNG 

No matter what I do the output is always false? Is this the correct trigger condition and formula or am I wrong?

 

Thanks for you time

 

Campbell

 

DamoBird365
Super User
Super User

Hi @Campbell 

 

A trigger condition is set on the trigger itself.  It will stop the flow from falsely triggering by putting a condition in place. This means that you will not see the flow run unless the progress field equals completed.  

 

DamoBird365_0-1614753116685.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

Thank you for you time @DamoBird365 

 

Firstly do you have a blog or is there a Microsoft blog I can read about the trigger conditions? I am fairly new to power automate and do not have a solid understanding of them, if you did that would be awesome!

 

I have tried the solution but am getting nothing. I edit the Progress column but nothing happens it is just continues looking for a trigger?

Flow 2.PNGTrigger Condition.PNGSharePoint.PNG

 

I think I have added it correctly but for what ever reason when I edit the column nothing happens?

 

Sorry for all the issues.

 

Cheers 

 

Campbell

Hi @Campbell 

 

Matt Weston did a good blog on trigger conditions here.

 

For your testing, you could remove the trigger condition.  It's only there to limit how often the flow runs.  It may be that the reponse to triggerOutputs()?['StatusColumn'] is not exactly as you expected. The best way to see that is to run the flow without the condition and then look back at the history.  You can click on the first step, i.e. the trigger and review the input data received.  Copy it out into notepad and you will be able to see the field and data received.  You then want to use that in your trigger going forward.

 

Trigger conditions are a nice way to limit when the flow runs, with it being when an item is created or modified, it would run every time someone makes a change, and ideally you just want it to run when the condition is set to 'completed'.

 

Feel free to post the input/output from your trigger and we can best advise on the trigger if it's a requirement or you don't understand.

Hi @DamoBird365 ,

 

Thank you for the blog it was quite helpful.

 

As I said at the start I have multiple flows running from SharePoint to Planner and I have manged to incorporate the delete planner task with another flow I had running. But I have taken yours and @gabibalaban suggestion about using a  trigger condition, and have managed to create multiple flows using a successful trigger condition. I will 100% use trigger conditions more often so Thank You.

 

Having said that all my flows are now working and I don't need any more help. I have selected one of your comments to be the solution.

 

Thank you for the help if you think its a good idea to continue this posts because it could be helpful to others I am more than happy to continue but as for me I have worked it out my self.

 

Thanks for your time and help.

 

Campbell

 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,509)