cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JunkoOhara Advocate I
Advocate I

Task to Planner - UTC Time conversion? problem with the time format

Hi All,

I'm trying to make a simple flow to save Tasks to Planner. I started from the Template, but simply it does not work at all.

I am suspecting the cause is the UTC time format or conversion or what ever it is, and tried as much as possible.

 

Error message is below: 

I also got the "The request is invalid:\r\nCannot convert the literal '2018-02-28 00:00:00Z' to the expected type 'Edm.DateTimeOffset" when I changed the Format string in Convert the time zone to Universal sortable date/time.

 And I am in South Africa.

{
  "error": {
    "code""BadRequest",
    "message""Property assignments in payload has a value that does not match schema.",
    "innerError": {
      "request-id""d836da73-a977-471b-bbde-6c95dfdde168",
      "date""2018-02-28T14:10:10"
    }
  }
}

 

Has anyone got a same problem?

201802281.png201802282.png

 

 

4 REPLIES 4
Highlighted
Super User
Super User

Re: Task to Planner - UTC Time conversion? problem with the time format

Hi @JunkoOhara

 

From looking at your screenshots, it seems your issue starts in the Condition step where you check for Due Date is equals to null. If you want to check for a null value, especially on a date, you should try the Coalesce function, which you can read more about it in this site. Additionally, I wrote a blog post a while back to show how to use the Coalesce function. Here's the link to the post 

Check for Null Value Using Flow

 

I hope this helps.

 

Regards,

Fausto Capellan, Jr


Fausto Capellan, Jr


Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

Proud to be a Flownaut!


Re: Task to Planner - UTC Time conversion? problem with the time format

I agree, it is the Null in your condition.







Did I answer your question? Mark my post as a solution!


Proud to be a Flownaut!






Community Support
Community Support

Re: Task to Planner - UTC Time conversion? problem with the time format

Hi @ JunkoOhara,

The error told that the time in the Data Time field isn’t the right format.

I have made a test on my side ,

If I create a flow as you, when I create a task with a null “Due date”, the action “Convert time zone” of the flow would have an error “Evaluation of inputs for the expression action of kind 'ConvertTimeZone' failed: 'Required property 'baseTime' expects a value but got null. Path ''.'.” , and the would run failed.

You should move the “Convert time zone” under the Condition.

You could create a flow as screenshots below to solve your problem:

 11.png

The expression of the “Condition” as below:

@empty(triggerBody()?['DueDateTime']?['DateTime'])

The expression of the “Start Data Time” as below:

formatDateTime(body('Convert_time_zone_2'),'yyyy-MM-ddT00:00:00Z')

The expression of the “Due Data Time” as below:

formatDateTime(body('Convert_time_zone'),'yyyy-MM-ddT00:00:00Z')

 

 

When a task with a null “Due date” is created in the “Outlook task”, the flow would run successfully as below:

12.png

When a task with a exist “Due date” is created in the “Outlook task”, the flow would run successfully as below:

 13.png

 

Regards,
Alice Zhang

JunkoOhara Advocate I
Advocate I

Re: Task to Planner - UTC Time conversion? problem with the time format

Thank you so much @v-yuazh-msft and @faustocapellanj.

I'm still strugling to get it work.

 

So far I have cut the problems, and now know that checking the 'Null' in the Due Date is not working for me so far.

I saw @faustocapellanj's blog and tried below;

@equals(coalesce(triggerBody()?['DueDateTime']?['DateTime'],''), '')

@equals(coalesce(triggerBody()?['DateFormat'],''),'')

@empty(triggerBody()?['DueDateTime']?['DateTime'])

 

All not working.. The problem is I really don't get the syntax in the first place.

So not sure what to put in, so just guessing around. I'm starting to think that this is too advanced for me..

 

2018-03-13 17_16_48-Edit your flow _ Microsoft Flow - Opera.png

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (7,725)