cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
nbuley
Level: Power Up

Expression for Due Date Time field on Planner task

Hi everyone! 

 

I'm trying to create a flow that creates a Planner task when a Form response is submitted. Where I'm specifically having trouble is on the task Due Date Time field. 

 

I need the due date to be three days before my Requested Send Date. The Requested Send Date is one of the data fields from my Form, and I've pulled it into the below expressions as: 

(body('Get_response_details')?['rd11379f17ee94ff5afe9aee5b6567aa5']

 

Here's the full expression I have in the Due Date Time field currently: 

 

addDays(body('Get_response_details')?['rd11379f17ee94ff5afe9aee5b6567aa5'],-3,'mm/dd/yyyy')

 

I've also tried: 

@equals(formatDateTime(body('Get_response_details')?rd11379f17ee94ff5afe9aee5b6567aa5'],'MM/dd/yyyy'),formatDateTime(addDays(body('Get_response_details')?rd11379f17ee94ff5afe9aee5b6567aa5'],-3),'MM/dd/yyyy'))

 

Both versions return status code 400 with this error message when I try to run the Flow: 

{
  "error": {
    "code": "",
    "message": "The request is invalid:\r\nCannot convert the literal '00/23/2018' to the expected type 'Edm.DateTimeOffset'.",
    "innerError": {
      "request-id": "814b5dd1-205d-4cef-8ccc-ef10a49e3887",
      "date": "2018-01-19T19:13:11"
    }
  }
}

I've looked at a bunch of the discussions here and tried to figure this out, but I am throroughly stuck. Any pointers would be greatly appreciated!! 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Expression for Due Date Time field on Planner task

Hi @nbuley,

 

Could you please share a screenshot of your flow's configuration?

 

The error message told that the value you provided within Due Date Time field of "Create a task" action is not valid, the "Create a task" action could not convert the value that you provided into a expected type.

 

I have made a test on my side and please take a try with the following workaround:

  • Add a "When a new response is submitted" trigger.
  • Add a "Apply to each", input parameter set to output of the trigger.
  • Within "Apply to each", add a "Get response details" action, Response Id field set to Response Id dynamic content of the trigger. 

         Add a "Create a task" action, Start Date Time field set to following formula:

utcNow()

       Due Date Time field set to following formula:

addDays(body('Get_response_details')?['rc787195479ff44329dd91fb703b380a8'],-3,'yyyy-MM-ddT00:00:00Z')

Note: I have pulled the Requested Send Date data field from my Form into following expression:

body('Get_response_details')?['rc787195479ff44329dd91fb703b380a8']

Image reference:2.JPG

The flow works successfully as below:3.JPG

 

Best regards,

Kris

Community Support Team _ Kris Dai
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

3 REPLIES 3
BigShotRob
Level: Powered On

Re: Expression for Due Date Time field on Planner task

 
Community Support Team
Community Support Team

Re: Expression for Due Date Time field on Planner task

Hi @nbuley,

 

Could you please share a screenshot of your flow's configuration?

 

The error message told that the value you provided within Due Date Time field of "Create a task" action is not valid, the "Create a task" action could not convert the value that you provided into a expected type.

 

I have made a test on my side and please take a try with the following workaround:

  • Add a "When a new response is submitted" trigger.
  • Add a "Apply to each", input parameter set to output of the trigger.
  • Within "Apply to each", add a "Get response details" action, Response Id field set to Response Id dynamic content of the trigger. 

         Add a "Create a task" action, Start Date Time field set to following formula:

utcNow()

       Due Date Time field set to following formula:

addDays(body('Get_response_details')?['rc787195479ff44329dd91fb703b380a8'],-3,'yyyy-MM-ddT00:00:00Z')

Note: I have pulled the Requested Send Date data field from my Form into following expression:

body('Get_response_details')?['rc787195479ff44329dd91fb703b380a8']

Image reference:2.JPG

The flow works successfully as below:3.JPG

 

Best regards,

Kris

Community Support Team _ Kris Dai
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

nbuley
Level: Power Up

Re: Expression for Due Date Time field on Planner task

Thanks so much for the help, Kris! 

 

Here is a screencap of my flow; your suggestion below worked. For whatever reason, changing the Start Date Time to the utcnow() function, rather than the 'Submission Date' value from the Form made the Flow run successfully. Thank you again! 

 

 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 284 members 3,648 guests
Please welcome our newest community members: