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

All Flows with Date Time Fail

I am building a simple Flow to create a Planner Task from an Outlook Task. Everything works fine until I use one of the Start Date Time or Due Date Time fields. I have tried using the "Compose" method as well as the built in Dynamic Content pieces. The error is always something along this:

 

The request is invalid:\r\nCannot convert the literal '' to the expected type 'Edm.DateTimeOffset'.","innerError":{"request-id":"838a456b-134c-4c24-90e0-4b340ad7b1c3","date":"2017-06-21T17:07:03"}}}

 

or

 

{"error":{"code":"BadRequest","message":"Property assignments in payload has a value that does not match schema.","innerError":{"request-id":"7e159e59-9e75-4982-af98-2f49070838b2","date":"2017-06-21T16:33:03"}}}

 

I have tried every DateTime format I can think of and I'm sick of banging my head on the wall for something so simple. I am in Canada, so perhaps the regional settings are an issue? 

 

19 REPLIES 19
Highlighted
Anonymous
Not applicable

Re: All Flows with Date Time Fail

For me too. 

Highlighted
Advocate I
Advocate I

Re: All Flows with Date Time Fail

I don not see the "Compose" capability in Planner actions. Where did you find it?

Thanks,

Roy

Highlighted
Anonymous
Not applicable

Re: All Flows with Date Time Fail

Roy, honesty I do not understand was Compose is. I use Planner Create a task action for making a Planner Task from RSS feed. When I insert dynamicaly Date of the feed posting I see that error. By the way the action lacks (like as Planner in a whole) a Task Description. To insert a description just after a task is created you can use Planner Update Task Details Description action.

Highlighted
Advocate I
Advocate I

Re: All Flows with Date Time Fail

Thanks,

Just updating that we were able to add a task with date field (copied from Project Online) by adding a 'Z'  right after the date value received from project.

I hope this helps you or anyone else that finds Flow somewhat lacking documentation.

 

Roy

Highlighted
Anonymous
Not applicable

Re: All Flows with Date Time Fail

Roy, thanks for the info! Maybe you know if operations with date are allowed in the date field? Something like: Today + 1Day? In this way I can fill a task`s Date of complition.

Thanks, Nikolay

Highlighted
Advocate I
Advocate I

Re: All Flows with Date Time Fail

Hi,

You can try using the variables for that: initialize a variable myDate and set its value to - @{addhours(utcnow(),4)}, than use the variable in your action (accepts strings only).

flowVarDate.PNG

 

Hope this helps

 

Roy

Highlighted
Community Support
Community Support

Re: All Flows with Date Time Fail

Hi RickBeec,

 

According to your description, I create a flow looks like below. About the Start Date Time field and Due Date Time field, I configure it with dynamic content from Office 365 Outlook.

4.PNG

 

Then when I create a new event to run the flow, it runs succeed. I don’t get the error you mentioned.

5.PNG

 

Is your flow configuration the same with mine? Please provide a screenshot for your flow configuration to help reproduce this issue on my side.

 

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Anonymous
Not applicable

Re: All Flows with Date Time Fail

Hi @v-yamao-msft In my case I was tried to set Task starting date from PublishDate of RSS feed. 

 

 

rss.png

Wat is wrong with this publishDate string?

Thanks.

 

Highlighted
Advocate I
Advocate I

Re: All Flows with Date Time Fail

Make sure it's a string (you can use formatDateTime function to get a string from you date object).

 

Highlighted
Anonymous
Not applicable

Re: All Flows with Date Time Fail

Thank you, Roy

... Flow somewhat lacking documentation 

Highlighted
Frequent Visitor

Re: All Flows with Date Time Fail

Hi,

 

Here are some screens from scenerios I have tried. Using Set Variable Method from Roy:

2017-06-22_094533.jpg

Results in:

2017-06-22_095609.jpg

2017-06-22_095628.jpg

Two things you can see here; 

1. The Variable is being treated as a literal. Not sure why?

2. The format of the date returned by the built in function. I am thinking this is the issue. 

 

 

Highlighted
Frequent Visitor

Re: All Flows with Date Time Fail

Hi,

 

Here are some screens from scenerios I have tried. Using Set Variable Method from Roy:

2017-06-22_094533.jpg

Results in:

2017-06-22_095609.jpg

2017-06-22_095628.jpg

Two things you can see here; 

1. The Variable is being treated as a literal. Not sure why?

2. The format of the date returned by the built in function. I am thinking this is the issue. 

 

 

Highlighted
Advocate I
Advocate I

Re: All Flows with Date Time Fail

Interesting, it works for me. Try formatting it using formatDateTime method (tested and working).

Make sure there are not leading/trainling whitespaces.

 

@{formatDateTime(addhours(utcnow(),4))}

 

Roy

Highlighted
Frequent Visitor

Re: All Flows with Date Time Fail

Hi Roy,

 

Thanks for the tip. I'm not sure why the function does not build the date for me, it only passes it directly. 

2017-06-22_120020.jpg

Highlighted
Advocate I
Advocate I

Re: All Flows with Date Time Fail

No problem, I wish it worked..

perhaps try taking it out of the compose action?

try adding initialize variable action:

flowVarDateFormula.PNG

Result:

flowVarDateFormulaResult.PNG

Highlighted
Frequent Visitor

Re: All Flows with Date Time Fail

Solved:

 

Reply to self for the benefit of everyone....

 

When setting up the Flow, enter what Roy posted, "@{addhours(utcnow(),4)}" and include the quotes. After saving, the quotes are gone, but the parameter is passed......

 

Thanks everyone.

Highlighted
Advocate I
Advocate I

Re: All Flows with Date Time Fail

I actually remember doing that, never would have thought this would be the issue.

Cheers

Highlighted
Anonymous
Not applicable

Re: All Flows with Date Time Fail

For me it works without quotes. But ... not everytime I save the flow. After several cycles of save, actualize and run it started to work again and the error disappeared. Strange. Anyhow @royg thanks for the help! 

 

Nikolay

Highlighted
Power Automate
Power Automate

Re: All Flows with Date Time Fail

Hey all,

 

Are you aware of the Date Time Conversion action? It's pretty neat and doesn't require you to write complex expressions.

Here is an example of computing a DT that should work for Planner or most other Microsoft based connectors.

 

image.png

 

image.png

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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
Top Kudoed Authors
Users online (7,384)