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

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


Super User
Super User

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

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

Highlighted
JunkoOhara
Level: Powered On

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

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