cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dmistry
Level 8

How to add completed task as a new task(to-do task) on a recurring basis in SP task list

Hi.

 

I am using an OOTB task list in SPO. The only custom metadata column I have is titled as Frequency (choice column) with choices: Annually, Quarterly, Monthly, Semi-Annually. When tasks are created, they are tagged with appropriate frequency choice value.

 

So now, when the task is marked as completed then I want to re-add that task with an updated due date. So probably using when item is created or modified trigger and then check task that are completed as condition and re-create the item in the same list using Create item action.

 

Now the main thing is updating the due date here based on Frequency value once a task is completed. So if Due Date for quarterly task is 2/15 then once marked as completed, it should be re-added to the task list with due date 5/15 (simply adding 3 months), similarly semi annually would require adding 6 months, annually requires adding a year, monthly would require adding one month to the due date value.

 

Can someone help me with the flow solution, thanks in advance.

4 REPLIES 4
Community Support Team
Community Support Team

Re: How to add completed task as a new task(to-do task) on a recurring basis in SP task list

Hi @dmistry .

 

I have made a test on my side to create a sharepoint list as below:

Capture.PNG

 

The Frequency column and Status Column are both choice type column.

Frequency column with choice:Annually, Quarterly, Monthly, Semi-Annually

Status Column with choice:Completed,NotCompleted

 

And you could refer to screenshot below to create the flow:

Capture.PNG

 

Note:

1.Make sure to choose the Status Value dynamic content in the Condition.

2. The expression in the Compose as below:

if(equals(triggerBody()?['Frequency']?['Value'],'Annually'),int(12),if(equals(triggerBody()?['Frequency']?['Value'],'Quarterly'),int(3),if(equals(triggerBody()?['Frequency']?['Value'],'Monthly'),int(1),if(equals(triggerBody()?['Frequency']?['Value'],'Semi-Annually'),int(6),null))))

3.The expression in the Due Date column as below:

addToTime(triggerBody()?['Due_x0020_Date'],outputs('Compose'),'Month')

When an item is created in the list as below:

Capture.PNG

 

The flow would run successfully as below:

Capture.PNG

Capture.PNG

 

An item would be created in the sharepoint list as below:

Capture.PNG 

Best regards,

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

 

dmistry
Level 8

Re: How to add completed task as a new task(to-do task) on a recurring basis in SP task list

@v-yuazh-msft  thanks for the solution. 

I am using SharePoint OOTB Task list not custom list, I used the same flow you provided for task list, but create item action skips. Compose action does return appropriate integer value based on frequecy column value, for example for Annually it returns 12, Monthly returns 1 etc. I do have notion of adding sub tasks to certain tasks so there were couple of apply to each block added by flow, one for predecessor and other for assigned to claims. Flow run shows successfully but create item does not execute.

flow1.JPGflow2.JPG

For my use case, even if a sub task is marked as completed, i have to make sure that its added again as a sub task under appropriate parent task.

P.S: Looks like the issue is with the Apply to each blocks, the moment I took both apply to each off, create item works, but then the question is, how will it work if a sub task is marked as completed, currently its creating it as a separate task with an updated due date and I can't have that.

dmistry
Level 8

Re: How to add completed task as a new task(to-do task) on a recurring basis in SP task list

@v-yuazh-msft , the formula looks a bit off as well, not doing the calculation right.

I have Due Date value set as 3/1/2019 and since frequency value was quarterly, it resulted into due date as '5/30/2019' . So its basically adding 90 days to the resulting due date and not the Months, it should be resulted into 6/1/2019.

 

@v-yuazh-msft  Any updates on this?

dmistry
Level 8

Re: How to add completed task as a new task(to-do task) on a recurring basis in SP task list

@v-yuazh-msft  Hi, I am still waiting you hear about any update on your end.

 

Also looks like it does not work well with the task list in sharepoint, i am using a task list not a custom list. The assignedto column is people picker. The same flow you mentioned if you try to use it with task list then under create item action, assinged to claims need to mapped to dynamically assigned to display name from trigger body and flow miserably fails. Any thoughts?

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 Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,118)