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 / Having error: Cannot c...
Power Automate
Unanswered

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

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard