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

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
Highlighted
Community Support
Community Support

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

View solution in original post

Highlighted
Regular Visitor

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')

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

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

View solution in original post

Highlighted
Regular Visitor

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')

View solution in original post

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Users online (7,473)