cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
demarchiori
Level: Powered On

Creating a flow to remove a planner task when an item is deleted on sharepoint

I have a flow that creates a planner task when I create an new item on sharepoint, I would like another flow to register on this planner task some details when this item is deleted on shapoint.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Creating a flow to remove a planner task when an item is deleted on sharepoint

Hi @demarchiori 

 

First of all you need to save the ID of SharePoint item in planner task.

I recommend to save the task in planner with Title =  ID - SharePoint Title.

 

Next you'll build your flow with "When a item is deleted", this action don't brings all item information, it's bring only ID and deletion information (How delete, when deleted and etc).

 

Your flow structure need to:

  • List all planner tasks
  • Use a condition to see if Task Title has the ID
    • I use the condition 
      first(split(items('Aplicar_a_cada')?['title'],','))
  • Update Task details (to add how and when deleted)
  • Update Task ( change status)

See the print bellow:

 

image.png

 


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


View solution in original post

2 REPLIES 2
Highlighted
Super User
Super User

Re: Creating a flow to remove a planner task when an item is deleted on sharepoint

Hi @demarchiori 

 

First of all you need to save the ID of SharePoint item in planner task.

I recommend to save the task in planner with Title =  ID - SharePoint Title.

 

Next you'll build your flow with "When a item is deleted", this action don't brings all item information, it's bring only ID and deletion information (How delete, when deleted and etc).

 

Your flow structure need to:

  • List all planner tasks
  • Use a condition to see if Task Title has the ID
    • I use the condition 
      first(split(items('Aplicar_a_cada')?['title'],','))
  • Update Task details (to add how and when deleted)
  • Update Task ( change status)

See the print bellow:

 

image.png

 


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


View solution in original post

Super User
Super User

Re: Creating a flow to remove a planner task when an item is deleted on sharepoint

  • Lets say your data is in ListA.
  • Create a list called ListB with following fields Title, PlannerID
  • When item is created in ListA use your existing planner creation flow to create an item in ListB set Title=ListA.ID and PlannerID to the PlannerTask created by your flow.

 

Then on your deleted item flow, query ListB where ID eq ListB.Title and then delete the PlannerTask by ID and also the list item.

 

Although you are storing a extra list of data, it is completely maintained by flow and you do not need to be restricted to what the title is called, and most likely your users will break your logic with the above method as they will rename things to make them more user friendly.

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,183)