Quick Info

This error means that the body should not have “__metadata” property or the ‘__metadata’ property is not formatted correctly.

Error

“The property ‘__metadata’ does not exist on type ‘SP.Data.POC_x0020_TasksListItem’.” It is a very common problem when calling SharePoint REST API (POST method). This issue can be resolved easily.

the property '__metadata' does not exist on type sp.data
Error Screenshot

#. Error Details


As you can see in the above screenshot, I am calling SharePoint API(method: POST) from Power Automate. This API is responsible for updating SP list item properties. As you can see the errors highlighted in orange color mentions that “The property ‘__metadata’ does not exist on type ‘SP.Data.ListType'”.

In simple words, this error means that the body is not supposed to have the “__metadata” property in it.

#. Why this error occurs?


This error can occur due to many reasons and one of them is wrong parameter being passed in the API request body. However I have included few tips to resolve the issue, check them below


Method 1: Correct Headers

Just like any other API call, you need pass few required parameters in SharePoint API call as well. If you are using Power Automate to call SharePoint API, then make sure to use the below headers, otherwise it may not work.

Accept: "application/json"
Content-Type: "application/json"
If-Match: "*"
X-HTTP-Method: "MERGE"

If your request body contains “__metadata” parameter then make sure to change the Content-type header as below

Content-Type: "application/json; odata=verbose"

On the other hand if you are using JavaScript or Postman to call the SharePoint API then check the below documents to find the correct parameters for header
https://stackoverflow.com/questions/64068314/post-request-to-sharepoint-list-the-parameter-metadata-does-not-exist-in-meth
https://sharepoint.stackexchange.com/questions/150437/rest-update-not-working

Method 2: Rectify request Body

the property '__metadata' does not exist on type sp.data error
ListItemEntityTypeFullName

As per this Microsoft document(as of 16th Nov 2021) you need to pass the ListItemEntityTypeFullName when calling the SharePoint REST API. But as per my testing, you do not need to pass it if you are not using the “odata” parameter in the header.

Unable to load image

Become a master of Windows PC

Learn all the troubleshooting techniques of Windows 10 PCs.
Buy Now : Amazon US, Amazon India

#. Final Result

I followed the same changes in the API call and I was able to call the API successfully.

the property '__metadata' does not exist on type sp.data

That’s all I have for resolving this issue the property ‘__metadata’ does not exist on type sp.data. I hope this has helped you to resolve your issue.


Newbietechie.com
Author @ramizmollahmd

About Ramiz

Ramiz is a professional working in an MNC as a business and technology consultant for quite a few years now. Ramiz is proficient in various Microsoft tools and technologies. He is a tech enthusiast and an active blogger. Ramiz spends his free time playing games or watching movies. He writes blogs to share his knowledge with the world and to make it a better place to live.


Please Help us Grow!

I hope you have found this article helpful. If you are happy with the document, please use the below links when you buy something from Amazon to help us grow.

How this works?

Amazon affiliate program gives a small (%)share of price to the referrers, so feel free to buy anything.
Below are some Amazon affiliate links, if you open amazon application/website using these links and buy something, (it can be one of the below items or anything of your choice) Then Amazon will give us a little percentage(%) of the money you spend on Amazon. To know more check this document.

Amazon Affiliate Links

$350-Best Student laptop
Amazon In, Amazon US

$600-Work laptop
Amazon In, Amazon US

$989– High performance
Amazon In, Amazon US

Headset – $15.99
Amazon In, Amazon US

Lightspeed Mouse – $39
Amazon In, Amazon US

Keyboard – $29
Amazon In, Amazon US

The Psychology of Money
Amazon In, Amazon

Atomic Habits:
Amazon In, Amazon

Find Balance and Purpose in Life
Amazon In, Amazon

$30, Smart Watch for Smart you
Amazon In, Amazon US, Amazon UK

Work comfortably with $110
Amazon In, Amazon US, Amazon UK

Exercise at home
Amazon In, Amazon US, Amazon UK

More Ways to Help

Thank you
For your Contribution

1 thought on “[Resolved] The property ‘__metadata’ does not exist on type ‘SP.Data.’”

  1. Pingback: SharePoint site groups REST API reference [CRUD] - _api/web/sitegroups

Leave a Comment