cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
melopodia
Helper I
Helper I

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 @melopodia ,

 

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 II
Super User II

Hello @melopodia 

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!

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!

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 @melopodia 

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!

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

Hi @melopodia ,

 

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 @melopodia 

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,479)