cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kerensky18
Level: Powered On

Forms to Planner Date Formula

Hello,

 

I'm receiving the following error when attempting to pass my due date from MS Forms to due date in Planner through my Flow. I've seen some examples via expressions like this post but I haven't been able to get that to work either.

 

Spoiler
{
"error": {
"code": "",
"message": "The request is invalid:\r\nCannot convert the literal '@concat(formatDateTime(triggerBody()?@{body('Get_response_details')?['r2fb0a018c0e74c289b020fd1b6084e36']},'O'),'Z')' to the expected type 'Edm.DateTimeOffset'.",
"innerError": {
"request-id": "82bc941b-c696-4b23-9ea3-b0701f134ddc",
"date": "2018-11-09T17:21:44"
}
}
}

Here is the flow currently:

 

image.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: Forms to Planner Date Formula

Hi @Kerensky18,

 

Which action run failed in your flow? Is it "Create a task" action of Planner connector?

Does the "Due Date" question in your Forms is Date type?

 

The error message that you provided mentioned that you have the expression '@concat(formatDateTime(triggerBody()?@{body('Get_response_details')?['r2fb0a018c0e74c289b020fd1b6084e36']},'O'),'Z')' in your flow, where is it?

 

 

Please make sure the "Due Date" question in your Forms is a Date type question,

Capture.PNG 

I have made a test on my side, you just need to add the "Due date" dynamic content of the "Get response details" action in the "Due Date Time" column of "Create a task" action, the screenshot of the flow as below:

Capture.PNG

The flow would run successfully as below:

Capture.PNG

 

If you want to formate the Due date time, please refer to screenshot below to create the flow:

Capture.PNG

The expression in the Due Date Time column of mine as below:

concat(formatDateTime(body('Get_response_details')?['r95a513173b194264b03fea5910035f11'],'O'),'Z')

 

And you need to use expression below in your Due Date Time column in your flow:

concat(formatDateTime(body('Get_response_details')?['r2fb0a018c0e74c289b020fd1b6084e36'],'O'),'Z')

The flow would run successfully as below:

 

Capture.PNG

 

Best regards,

Alice

Kerensky18
Level: Powered On

Re: Forms to Planner Date Formula

Hello,

 

I have it set as the dynamic content and it still fails. I think because it doesn't have a time and it assumes it's before the request was made. I'm using utc now as the request start date.

 

Spoiler
{
"error": {
"code": "",
"message": "Schema validation has failed. Validation for field 'DueDate', on entity 'Task' has failed: DueDate cannot be earlier than the StartDate",
"innerError": {
"request-id": "e43a2781-785e-4bd3-aae3-19f9eeddf051",
"date": "2018-11-12T16:01:47"
}
}
}

image.png

 

So I tried to use the forms submitted time and received this error:

Spoiler
{
"error": {
"code": "",
"message": "The request is invalid:\r\nCannot convert the literal '11/12/2018 4:01:33 PM' to the expected type 'Edm.DateTimeOffset'.",
"innerError": {
"request-id": "6e2389aa-244d-4784-a81a-0afd417081c6",
"date": "2018-11-12T16:07:38"
}
}
}

The final solution which I got to work is with this format:

@formatDateTime(utcnow(),'yyyy-MM-dd')
2 REPLIES 2
Community Support Team
Community Support Team

Re: Forms to Planner Date Formula

Hi @Kerensky18,

 

Which action run failed in your flow? Is it "Create a task" action of Planner connector?

Does the "Due Date" question in your Forms is Date type?

 

The error message that you provided mentioned that you have the expression '@concat(formatDateTime(triggerBody()?@{body('Get_response_details')?['r2fb0a018c0e74c289b020fd1b6084e36']},'O'),'Z')' in your flow, where is it?

 

 

Please make sure the "Due Date" question in your Forms is a Date type question,

Capture.PNG 

I have made a test on my side, you just need to add the "Due date" dynamic content of the "Get response details" action in the "Due Date Time" column of "Create a task" action, the screenshot of the flow as below:

Capture.PNG

The flow would run successfully as below:

Capture.PNG

 

If you want to formate the Due date time, please refer to screenshot below to create the flow:

Capture.PNG

The expression in the Due Date Time column of mine as below:

concat(formatDateTime(body('Get_response_details')?['r95a513173b194264b03fea5910035f11'],'O'),'Z')

 

And you need to use expression below in your Due Date Time column in your flow:

concat(formatDateTime(body('Get_response_details')?['r2fb0a018c0e74c289b020fd1b6084e36'],'O'),'Z')

The flow would run successfully as below:

 

Capture.PNG

 

Best regards,

Alice

Kerensky18
Level: Powered On

Re: Forms to Planner Date Formula

Hello,

 

I have it set as the dynamic content and it still fails. I think because it doesn't have a time and it assumes it's before the request was made. I'm using utc now as the request start date.

 

Spoiler
{
"error": {
"code": "",
"message": "Schema validation has failed. Validation for field 'DueDate', on entity 'Task' has failed: DueDate cannot be earlier than the StartDate",
"innerError": {
"request-id": "e43a2781-785e-4bd3-aae3-19f9eeddf051",
"date": "2018-11-12T16:01:47"
}
}
}

image.png

 

So I tried to use the forms submitted time and received this error:

Spoiler
{
"error": {
"code": "",
"message": "The request is invalid:\r\nCannot convert the literal '11/12/2018 4:01:33 PM' to the expected type 'Edm.DateTimeOffset'.",
"innerError": {
"request-id": "6e2389aa-244d-4784-a81a-0afd417081c6",
"date": "2018-11-12T16:07:38"
}
}
}

The final solution which I got to work is with this format:

@formatDateTime(utcnow(),'yyyy-MM-dd')

Helpful resources

Announcements
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!

thirdImage

New Flow Community Board!

Check out the new Microsoft Flow Community Blog Topic Suggestion board!

fourthImage

Australia Summit

Travel to Melbourne and network with thousands of peers!

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: 22 members 4,346 guests
Please welcome our newest community members: