cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

AddDays expression

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

 

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

8 REPLIES 8
fchopo
Super User
Super User

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

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
Anonymous
Not applicable

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).  

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

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
Anonymous
Not applicable

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

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

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
Anonymous
Not applicable

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

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.

View solution in original post

Hi @Anonymous 

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

 

 

 

 

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,815)