Looking for some help adding 2 fields together into a third date field. Below are the 2 fields needed to calculate/update the third field.
'Actual Start Date' (date field):
PLUS
'Assignment Length' (decimal field which is entered in as months. So this would read as 5 months)
EQUALS
'Estimated End Date' (date field)
Not sure if this would end up just being a calculated field but wanted to know if it can be done via a power automate flow.
Thanks in advance.
Solved! Go to Solution.
Hi @Shap1
@ryleybauer above its mentioned that 'Assignment Length' (decimal field which is entered in as months. So this would read as 5 months)
There is no addMonths() expression available in PowerAutomate but there is another action called Add To Time there. Please see below.
Above expression I used are
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogYou could do it either way.
If you did it as a flow, you could use the "When an item is created or modified" trigger, a "Compose" step using the "addDays()" expression (it requires integer integers though, but I think an int() conversion will round). Finally, add an "update item" step with all of the required fields and the "outputs" from the compose step into the date field.
It'd be easier as an SPO calculated column in my opinion.
Calculated Field Formulas | Microsoft Docs
For "Estimated End Date", Try:
=['Actual Start Date'] + ROUNDUP(PRODUCT(['Assignment Length'],30),0)
(I don't remember if you need single quotes around column names with spaces, try without if it doesn't work)
Please mark as solution if I've helped with this!
Hi @Shap1
@ryleybauer above its mentioned that 'Assignment Length' (decimal field which is entered in as months. So this would read as 5 months)
There is no addMonths() expression available in PowerAutomate but there is another action called Add To Time there. Please see below.
Above expression I used are
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogYou're right that there is no add months function. I think the Add to time action is a good suggestion for proper time units of "months"!
I just used addDays(DATE, int( 'Assignment Length' * 30)), which assumes a 30 day month.
While this is the Power Automate forum, it's probably easier to do a calculated column as you can simply add days to a date with the "+" operator:
=['Actual Start Date'] + ROUNDUP(PRODUCT(['Assignment Length'],30),0)
Hi @ryleybauer
The issue here is it doesn't give the exact date 30,31 or leap years.
Thanks for your reply.
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blog@abm @ryleybauer thank you both for your input.
I went the flow route and it worked! Really appreciate the help.
Hello @abm @ryleybauer- I am getting a lot of errors now and not exactly sure. Perhaps you can help:
Hi @Shap1 , can you please provide a screenshot of the output from your compose_2 step? The error message says the date is null.