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 / Can't convert string t...
Power Automate
Unanswered

Can't convert string to date to set new date only field

(0) ShareShare
ReportReport
Posted on by 664

I am trying to use an input from Power Apps to create a new record in a CDS entity. Below is part of my Flow configuration.

Config.PNG

I am initializing a string variable called Modified with the value coming from Power Apps. While testing, it is 3/31/2020. In the compose, the full Expression is

 

formatDateTime(variables('Modified'),'MM/dd/yyyy')

 

The Create a new record is not shown in full but in the Date field, I am just selecting Outputs from dynamic content.

The error I get is "An error occurred while validating input parameters: Microsoft.OData.ODataException: Cannot convert the literal '03-31-2020' to the expected type 'Edm.Date'...."

The date field is Date Only type and in Advanced options, behavior is Date only

I am not sure what's wrong with this. I have tried a few other variations of date formatting but haven't gotten it to work. Are there any other problems I'm missing with this?

Categories:
I have the same question (0)
  • Jcook Profile Picture
    7,781 Most Valuable Professional on at
    Hello,

    Have you tried using the convert time zone action?
    In the action use Short date pattern as the format string.

    Or try using
    convertFromUtc('<Time to Format>', 'Pacific Standard Time', 'd')

    You can swap the Pacific Standard Time with your time zone. But must follow Microsoft’s ISO
    https://support.microsoft.com/en-us/help/973627/microsoft-time-zone-index-values

    —Josh
    If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others
  • Cooper01 Profile Picture
    664 on at

    Thank you for the response. I tried using the Convert time zone which is working fine. I am using the Converted time output as my field in Create a new record. The conversion seems to work but am still getting the same error on Create a new record.

    Capture2.PNG

    From Create a new record

    Capture3.PNG

    In Create a new record, I also tried using the following expression

    convertFromUtc('2020-04-01T08:00:00.0000000Z', 'Pacific Standard Time', 'd')

    with both single and double quotes around d and got the same error 

    "An error occurred while validating input parameters: Microsoft.OData.ODataException: Cannot convert the literal '04-01-2020' to the expected type 'Edm.Date'..."

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard