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

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.

View solution in original post

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (1,205)