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 / Cannot convert a primi...
Power Automate
Unanswered

Cannot convert a primitive valueCannot convert a primitive value to the expected type 'Edm.DateTime'

(0) ShareShare
ReportReport
Posted on by 2

Hello,

 

I am experiencing an issue with the flow I am building, and I would appreciate the community's help in resolving it. Here are some statements about the flow and its functions:

 

  1. The flow retrieves data from an Excel table.
  2. The data is then sent to a SharePoint list using an HTTP request.
  3. The SharePoint list contains different data types, including classic, date format (yyyy-MM-dd), number, and single line of text.

 

The issue occurs at a particular step, which is shown in the attached picture.  I have tried using various formulas, but none of them have resolved the issue.

 

if(empty(items('Apply_to_each_3')?['StartDate']), null, formatDateTime(addDays('1899-12-30', int(items('Apply_to_each_3')?['StartDate'])), 'yyyy-MM-dd'))

if(empty(items('Apply_to_each_3')?['StartDate']), '', formatDateTime(addDays('1899-12-30', int(items('Apply_to_each_3')?['StartDate'])), 'yyyy-MM-dd'))

if(empty(items('Apply_to_each_3')?['StartDate']), '1900-01-01', formatDateTime(addDays('1899-12-30', int(items('Apply_to_each_3')?['StartDate'])), 'yyyy-MM-dd'))

 


AlexDuma_0-1682540326032.png

 

Every time I am getting this error:

Cannot convert a primitive value to the expected type 'Edm.DateTime'. See the inner exception for more details.
clientRequestId: 1f1d6fb3-8075-400a-b372-111b2755f481
serviceRequestId: f912ada0-b074-6000-7f2a-27f4091d0660

I am new to this forum and I am hoping to receive assistance from the experts here.

Thank you in advance for your support and guidance.

 

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

    Hi @AlexDuma ,

     

    It seems you put quotes '' around the formula. You could remove the quotes '' and try.

     

     

    Best Regards,

    Habsburg Qian

    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • AlexDuma Profile Picture
    2 on at

    Hi @v-zhoqian-msft 

    well, after removing single quotes I get this error:

    Invalid JSON. An unexpected comma was found in scope 'Property'. A comma is only valid between properties of an object or between elements of an array.
    clientRequestId: a748a79b-c197-4bc0-8df1-f4e595585451
    serviceRequestId: a252ada0-d061-6000-804c-0f1a9c8ee72d

    thank you

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