This error means that the body should not have “__metadata” property or the ‘__metadata’ property is not formatted correctly.
“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.
#. 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"
Method 2: Rectify request Body
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.
#. Final Result
I followed the same changes in the API call and I was able to call the API successfully.
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.
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.