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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Having error: Cannot c...
Power Automate
Answered

Having error: Cannot convert a primitive value to the expected type 'Edm.DateTime'

(0) ShareShare
ReportReport
Posted on by 359

I have an http request that updates a task in project that is triggered by clicking button in powerapps. I am however having an issue when trying to update the start date of the task since the data that I send through powerapps is not accepted.

 

This is the flow action that I use.

 

FlowHttpRequestCensored.png

My issue occurs on the last line with Start. I am passing a SelectedData value from a Date Picker object in Power Apps.

 

selecteddate.png

I am getting an error saying: Cannot convert a primitive value to the expected type 'Edm.DateTime'. Do I need to cast? I am not very familiar with JSON. Thank you.

Categories:
I have the same question (0)
  • v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @Mgodby ,

     

    First, you need to make sure that the value of this Dynamic content output is not empty.

    Second, you can try to format this value into the format required by the Start field using the formatDateTime() function.

    Please take a try.

     

    Best Regards,

  • Verified answer
    Mgodby Profile Picture
    359 on at

    I looked into and found out that I needed to format the date into the ISO 8601 format. 

    Text(UpdateStartDateInput.SelectedDate,"[$-en-US]yyyy-mm-ddThh:mm:ss") worked for me.

  • v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @Mgodby ,

     

    If you have found a solution to the issue, please click "Accept as Solution" on the reply that describes how you were able to solve your issue!

     

    Best Regards,

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    The solution the OP wrote in the reply is the solution to this problem.

     

    I had the same issue and none of the convert or date format options in Flow resolved it.    I also had to format my date in the PowerApp using this:

     

    Text(dpDate.SelectedDate,"[$-en-US]yyyy-mm-ddThh:mm:ss")

     

    And then use that value from the parse JSON action directly in the Send HTTP request.  Every other date from the various formatting and convert methods that were recommended in other posts and answers failed with the original 'Cannot convert a primitive value to the expected type 'Edm.DateTime' error.   This is the only solution that worked.

     

    SendHTTPDate.png

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard