cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
anthonys123
Helper III
Helper III

Cannot convert the literal '' to the expected type 'Edm.DateTimeOffset'.

My flow starts as a form (Manually Trigger a Flow). Part of the form has optional date picker fields for project due dates. 

This flow creates a Planner bucket with six tasks which often do not have due dates. When the due dates in the form are left blank, I'm often getting the error below (but not every time). 

 

{
  "error": {
    "code": "",
    "message": "The request is invalid:\r\nCannot convert the literal '' to the expected type 'Edm.DateTimeOffset'.",
    "innerError": {
      "date": "2021-04-16T13:34:18",
      "request-id": "IDretracted",
      "client-request-id": "IDretracted"
    }
  }
}

 

Screen Shot 2021-04-16 at 9.47.37 AM.png

4 REPLIES 4
fchopo
Super User
Super User

Hi @anthonys123 

Try to use the "null" value inside the due date field. Be careful, "null" should be written as an expression, and not as a string.

null.png

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

@fchopo Sometimes there's a due date and sometimes there isn't. Null wouldn't work when a due date is set by the user.  How might I compose a 'Due Date Output' from the user's input whether the field is filled or null?

I have six due dates and my flow is repeated 4 times. So, the cleaner the better. 

Thanks!

fchopo
Super User
Super User

You could use an expression like: 

if(equals(outputs('Get_response_details')?['body/submitDate'],''),null,outputs('Get_response_details')?['body/submitDate'])

Using your form's date question instead of "submitDate".

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
anthonys123
Helper III
Helper III

@fchopo I'm stumped. Below, I'm working with a submission that has the date entered.

The question on my form is Final Due. When I open the Raw Input, I see; 

 

            "date": {
                "title": "Final Due",
                "type": "string",
                "format": "date",
                "x-ms-dynamically-added": true,
                "description": "Please enter or select a date (YYYY-MM-DD)",
                "x-ms-content-hint": "DATE"

 

The Raw Output is; 

 

    "body": {
        "text": "First",
        "text_1": "Last",
        "text_2": "4545 First St",
        "text_3": "Miami",
        "text_4": "Client Residence",
        "text_5": "Big Building",
        "date": "2021-06-25",
        "date_1": "2021-06-25",
        "boolean": true,
        "date_2": "2021-06-25",
        "boolean_1": true,
        "date_3": "2021-06-25",
        "date_4": "2021-06-25",
        "date_5": "2021-06-25",
        "text_8": "Anthony",
        "text_9": "Active"

 

 

I have tried the following;

 

if(equals(outputs('Get_response_details')?['body/Final Due'],''),null,outputs('Get_response_details')?['body/Final Due'])

if(equals(outputs('Get_response_details')?['body/date'],''),null,outputs('Get_response_details')?['body/date']) 

 

 

All variations are giving me the same error; 

 

Correct to include a valid reference to 'Get_response_details' for the input parameter(s) of action 'Final_Due_1'. 

 

 

Screen Shot 2021-04-16 at 4.00.40 PM.png

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,294)