cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OttarLM
Regular Visitor

Create a task, date formatting

Hi,

 

I am building a flow that is triggered by MS forms.

 

I want to use "submission time" plus 30 days as "Due Date Time".

I have tried many different methods to achieve this, without luck.

 

The most promising methods I have found is to use an expression with "addDays".

I have tried to format the date in this expression, but I can't seem to get it right.

 

Now I am hope some of you can help me get this flow working.

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @OttarLM,

 

@Rahber is correct, there should use the submitDate property to add the time, one point need to correct is the date format should be "yyyy-MM-dd", if the date format is "dd-MM-yyyy", when creating a planner task, it will recognize an invalid date:

addDays(body('Get_response_details')?['submitDate'],30,'yyyy-MM-dd')

Annotation 2020-06-29 175624.jpg

 

Best Regards,
Community Support Team _ Lin Tu
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

2 REPLIES 2
Rahber
Solution Sage
Solution Sage

Hello,

 

You can use this dynamic expression only for getting the DueDate

formatDateTime(addDays(body('Get_response_details')?['submitDate'],30),'dd-MM-yyyy')

 

Please note that body('Get_response_details')?['submitDate'] is the value of the SubmissionTime variable from the response so make sure you are correctly referring it. To get the value move the mouse over variable and it will show you its syntax and then remove the variable and use the custom expression.

Untitled.jpg

 

 

Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

Thanks,

Rahber

v-litu-msft
Community Support
Community Support

Hi @OttarLM,

 

@Rahber is correct, there should use the submitDate property to add the time, one point need to correct is the date format should be "yyyy-MM-dd", if the date format is "dd-MM-yyyy", when creating a planner task, it will recognize an invalid date:

addDays(body('Get_response_details')?['submitDate'],30,'yyyy-MM-dd')

Annotation 2020-06-29 175624.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (1,343)