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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,192)