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

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

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

4 REPLIES 4
Community Support
Community Support

 

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,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

View solution in original post

 

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,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

 

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (7,304)