web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Cannot convert the lit...
Power Automate
Unanswered

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

(1) ShareShare
ReportReport
Posted on by 457

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

Categories:
I have the same question (0)
  • fchopo Profile Picture
    8,003 Moderator on at

    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

  • anthonys123 Profile Picture
    457 on at

    @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 Profile Picture
    8,003 Moderator on at

    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

  • anthonys123 Profile Picture
    457 on at

    @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

  • SourabhRoy Profile Picture
    2 on at

    This issue i have seen in many cases like date and Integer case. This happens because Flow is trying to post as empty string instead of null even though you have added null in expression.

    In Logic app, we used to go to code view and remove curly bracket after @ symbol for the expression. In flow, you need to add full expression including @ symbol to work

     

    Example: In code view if you add the above expression, it will look like below:

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

     

    You need to change like below then it will accept both null value and date value.

    @Anonymous(equals(outputs('Get_response_details')?['body/Final Due'],''),null,outputs('Get_response_details')?['body/Final Due'])  => just remove curry bracket after @ in expression

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard