cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ClevrCompuBloke
Helper II
Helper II

Incrementing Planner due date by xxx variable

Im tring to create a planner item with a due date that is picked up from the donor SharePoint list (along with the other items on the list). We want the list to act as a donor for monthly tasks, so it would not be good to get this from a due date in SharePoint as each month its moved on by a month.  On the basis we import tasks on a fixed basis (1st of every month) the due date would be x from UTC date ( so a value of 5 in the donor list, would increment today+5)

 

The due date varies per task so I dont want to use a fixed date in the adddays expression (which works fine) but want to get a number from the getitem in SharePoint.

 

Can anyone help or suggest a better way ?

🙂

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @ClevrCompuBloke 

 

The expression we discussed is as follows:

 

addDays(utcNow(),int(items('Apply_to_each')?['Daysfromdeadline']),'yyyy-MM-dd')

 

Thanks

 

 

 

 



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

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

17 REPLIES 17
abm
Super User
Super User

Hi @ClevrCompuBloke 

 

Is that number stored in SharePoint? Are you looking this number to add to Todays date?

 

Thanks



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

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Hello.

The current thought process is that the number would be stored in a SharePoint list. This gives each team the ability to change the monthy tasks for the next month and the day of the month they should be done by.

 

Yes to adding it to todays date

 

We dont want to store the variable as a date, as we dont seem to be able to update the date easily each month so they can be used on a repetitive basis.

hi @ClevrCompuBloke  could you share an screnshot of your flow? If you use te conector Get Item you are able to extract everything in the sharepoint list to use it in your flow, I'm litle confuse



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

Hi @ClevrCompuBloke 

 

If you looking to add the days from todays date then you can use the below expression

 

addDays(utcNow(),3)
 
Here I have hardcoded the value 3. So in your case you can map the SharePoint Get Items number column instead of 3. Make sure that number column is numeric. If not numeric you can use expression int() to convert the number.
 
Thanks


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

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Thanks for that, we are close. I used ther static version you put in, but am unsure how to give the expression the correct syntax for the list item in SharePoint.

 

Ill do a screenshot and add it here.

Hi @ClevrCompuBloke 

 

Thanks for your quick reply

 

Please see below. Click the expression tab and add your expression.

 

My SharePoint field is UNR which is a string so I used the below expression. 

 

addDays(utcNow(),int(body('Get_item')?['UNR']))

 

image.png



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

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
abm
Super User
Super User

Hi @ClevrCompuBloke 

 

 

Forgot to add the SharePoint Get Item step. 

 

Here it is

 

image.png

 

 

 



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

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

@abm 

 

Thanks for the update, I added the compose and then put the output of the compose in and just ran it (changed my column to match yours) and got the error below

 
"status": 400,
"message": "The string was not recognized as a valid DateTime. There is an unknown word starting at index 0.\r\nclientRequestId: e4459b71-1f0b-4312-8bde-de3de39f0dac\r\nserviceRequestId: e4459b71-1f0b-4312-8bde-de3de39f0dac"
}
 
flow #3.PNG

Hi @ClevrCompuBloke 

 

Thanks for your reply.

 

You could format the compose output to below format

 

formatDateTime(outputs('Compose'),'yyyy-MM-dd')

 

Thanks



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

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Hi again @abm  that is beyond my current Friday afternoon skills, can you elaborate please...

Hi @ClevrCompuBloke 

 

Sharepoint is expecting the compose output in DateTime format. So what I suggested is convert the output in datetime format. Remove the current mapping of output from SharePoint Due Date. Focus the mouse in that field then click the expression and copy the expression I provided earlier. Click ok.

 

Let me know how it goes.

 

Thanks



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

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

@abm  once again thank you 🙂

 

So get this error now:

 
InvalidTemplate. Unable to process template language expressions in action 'Format_number' inputs at line '1' and column '2816': 'In function 'formatDateTime', the value provided for date time string 'addDays(utcNow(),int(body('Get_item')?['UNR']))' was not valid. The datetime string must match ISO 8601 format.'.
 
flow #4.PNG

Hi @ClevrCompuBloke 

 

Believe you have added my expression straight away. You need to modify the UNR to your filed number. That was an example also I don't have your schema name. Can we do a screen share? 

 

Thanks



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

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

@abm  of course to screenshare, but I am leaving the office in 11 mins so perhaps when you are next free?

 

Ill PM you if that is OK with more information.

Hi @ClevrCompuBloke 

 

The expression we discussed is as follows:

 

addDays(utcNow(),int(items('Apply_to_each')?['Daysfromdeadline']),'yyyy-MM-dd')

 

Thanks

 

 

 

 



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

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

HUGE shout out to @abm , who took time to help and explain. we now have a working solution that takes a number column from SharePoint and adds it to a recurring task in SharePoint.

 

Really great solution

Hi @ClevrCompuBloke 

 

Thanks for your kind words. Really appreciated it. 

 

It's a pleasure to pass my knowledge to others. This is an awesome community and lots of good knowledge here.

 

Special thanks to @GabrielStJohn for keep this community going.

 

Thanks



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

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Helpful resources

Top Solution Authors
Users online (3,405)