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 Automate
Answered

AddDays expression

(0) ShareShare
ReportReport
Posted on by

What do I need to type in this expression to get the Due Date to be Start Date (which is a field from a Form) + x days.

AddDays-forum post.jpg

 

Categories:
I have the same question (0)
  • fchopo Profile Picture
    8,003 Moderator on at

    Hello @Anonymous 

    For example, to add 2 days to the start time field, you could use an expression like:

    addDays(body('USB_Drive_()')?['Start_Date'];2)

     

    Hope it helps.

    Ferran

  • Community Power Platform Member Profile Picture
    on at

    Thanks, I don't think that's quite what I need. The field that will have the calculated date is the Due Date" and the date it shows needs to be "Startdate" field from the form + 5 days (for example).

     

    e.g. the form Start Date is Feb 20th. So Due Date field should be Feb 20th+5 days = 25th (but the Start Date is not manually entered it comes from the Form Field).  

  • fchopo Profile Picture
    8,003 Moderator on at

    So, if I understand, you need the start date field from the form response, isn't it? Therefore the expression should be:

    addDays(body('get_response_details)?['StartDate'];5)

    Hope it helps.

    Ferran

  • Community Power Platform Member Profile Picture
    on at

    I got this error..

     
    "error": {
    "code": "",
    "message": "The request is invalid:\r\nCannot convert the literal 'addDays(body('get_response_details)?['2020-02-12'];5)' to the expected type 'Edm.DateTimeOffset'.",
    "innerError": {
    "request-id": "8a1ca5c4-8ebe-4044-ab10-70eb12be8cd9",
    "date": "2020-02-11T19:36:35"
    }
    }
    }
    flow error-b-2-11.JPG
    Flow error 2-11.JPG
  • fchopo Profile Picture
    8,003 Moderator on at

    Hello @Anonymous 

    You should use formatDateTime function to convert date value to string, as it is expected to create the task in Planner. Have a look at this sample (visit_date is a date field in the form):

    Date_Flow.png

     

    Hope it helps!

    Ferran

  • Community Power Platform Member Profile Picture
    on at

    Thanks...where would the AddDays expression be placed in this?

  • Verified answer
    v-alzhan-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    Please refer to screenshot below to create the flow:

    1.png

     

    The expression for the Due Date Time field as below:

    add(outputs('Compose'),2)

     

     

    Best regards,

    Alice       

     

    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.

  • fchopo Profile Picture
    8,003 Moderator on at

    Hi @Anonymous 

    I don't understand your question... Anyway, you could place the formula inside the "Due Date" field in planner task.

     

     

     

     

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