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

Issues updating SharePoint list item Date field using Send HTTP Request to SharePoint

Hi everyone and thank you in advance for helping me identify what I'm doing wrong.

I am able to update list item string and number fields just fine using Send HTTP Request to SharePoint but not Date Time fields.

 

This is the body.  Yes, in this example I am hard coding the value for simplicity right now.

{
"Event_x0020_Date": "6/7/2020"
}

 

And this is the output:

{
  "status"400,
  "message""Cannot convert a primitive value to the expected type 'Edm.DateTime'. See the inner exception for more details.\r\nclientRequestId: 973395f0-5f20-49f6-8401-1cc1afade3f6\r\nserviceRequestId: 43ae789f-408a-b000-18a1-c4821d86161f",
  "errors": [
    "-1",
    "Microsoft.SharePoint.Client.InvalidClientQueryException"
  ]
}
 
Any idea how the string needs to be formatted in the http body?
1 ACCEPTED SOLUTION

Accepted Solutions
PrasadAthalye
Super User
Super User

Can you try following format and see if that works?

 

2020-06-18T19:00:17Z

 

OR

 

2020-06-18 19:00:17

 

Mark this as an answer if this resolves your issue.

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community

View solution in original post

2 REPLIES 2
PrasadAthalye
Super User
Super User

Can you try following format and see if that works?

 

2020-06-18T19:00:17Z

 

OR

 

2020-06-18 19:00:17

 

Mark this as an answer if this resolves your issue.

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community

View solution in original post

CFernandes
Super User
Super User

@Ellsworth03054 

 

I have come across this problem in the past with the HTTP action and the issue was with formatting the date in the JSON file. 

{
"Event_x0020_Date": "2020-09-11T18:30:49-0300"
}

Reference article: 

http://blog.plataformatec.com.br/2014/11/how-to-serialize-date-and-datetime-without-losing-informati... 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (3,106)