cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Mgodby
Level: Powered On

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
Mgodby
Level: Powered On

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

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

3 REPLIES 3
Community Support Team
Community Support Team

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

 

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.
Mgodby
Level: Powered On

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

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

Community Support Team
Community Support Team

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

 

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.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,864)