web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Need to subtract days ...
Power Automate
Answered

Need to subtract days from one date field with result in another.

(1) ShareShare
ReportReport
Posted on by 10
I have a SharePoint list with a few date fields. Only one of these is entered upon item creation. This field is titled [ProposalDueDate]. I have 2 other date fields that need to calculate a date off of [ProposalDueDate]. These fields are [EstimateDueDate] and [TakeOffDueDate]. In layman's terms... [EstimateDueDate] should calculate as [ProposalDueDate] minus 5 days [TakeOffDueDate] should calculate as [ProposalDueDate] minus 10 days I do not have much experience in SharePoint or Flow, but I have a little is VBA. I tried to do something that was logical to me in the Dynamic Content tab but that doesn't work. [ProposalDueDate]-5 I have searched google for days to find this solution but having no luck. Any help pointing me in the right direction would be great. Thanks,
Categories:
I have the same question (0)
  • Verified answer
    v-bacao-msft Profile Picture
    on at

    Hi @Koreno,

     

    You could get the corresponding date using the addDays() function in Expression.

    Image reference:

    69.PNG

    EstimateDueDate: addDays(triggerBody()?['ProposalDueDate'],-5)

    TakeOffDueDate: addDays(triggerBody()?['ProposalDueDate'],-10)

    For more usage of expressions and WDL functions, please refer to the link below:

    https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference

    Please take a try.

     

    Best Regards,

    Barry

  • Koreno Profile Picture
    10 on at

    Thank you for the reply. I have been very busy lately with my primary duties (estimator) so I will try this solution when I can get back into this. When I do, I will let you know how is turned out. Thank you for the time.

  • Koreno Profile Picture
    10 on at

    I decided to give it a try just now. It worked perfect. Thank you much.

     

    I do however have another question. Instead of setting those 2 dates in a flow, could I make the field calculated so not only when an item is created, but also when the proposal due date is changed, the estimate and take off due dats just automatically update? Something like =ProposalDueDate-5 or =ProposalDueDate-10

     

    Capture.JPG

  • v-bacao-msft Profile Picture
    on at

    Hi @Koreno,

     

    Yes, you could create  Calculated column, based on ProposalDueDate.

    In addition, this could also be achieved through Flow.

    You could set When an item is created or modified as  trigger, and you could achieve the effect you want.

    If this answers your question, please mark the post as solved.

     

    Best Regards,

    Barry

  • Koreno Profile Picture
    10 on at

    When I try to do this as a caculated field, I get errors and it wont let me. Could you give the the correct code to put in the box?

  • v-bacao-msft Profile Picture
    on at

    Hi @Koreno,

     

    You could select the corresponding column to perform the calculation.

    Like:

    53.PNG

    Please take a try.

     

    Best Regards,

    Barry

  • WDRC Profile Picture
    247 on at

    @v-bacao-msft 

     

    Any idea how I automate adding say 365 days to a date or 366 in a leap year.  The issue in mind is that an insurance certifcate runs out at the end of the month.  So during a process I always want to be able to add the correct amount of days for the different condtions.  So thus the certicate expiry should allways be the end of the month not say a day early.  It then needs to write the correct date to the SP list.  I only ask this as 2020 will be such a year.

     

    Regards,

     

    Andrew

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard