I'm performing the following request to update the value of "ExampleColumn#" for a Sharepoint Online item:
PATCH https://graph.microsoft.com/v1.0/sites/{site_id}/lists/{list_id}/items/{item_id}
With the following request body:
{
"fields":{
"ExampleColumn#": 1
}
}
Returns a 400 bad request error, with the following message:
"message": "A metadata reference property was found in a JSON Light request payload. Metadata reference properties are only supported in responses"
As I believe Odata requires the "#" symbol to be escaped, I've tried using percent-encoding which I couldn't get to work.
Request Body:
{
"fields":{
"ExampleColumn%23": 1
}
}
Response:
"message": "Field 'ExampleColumn%23' is not recognized"
What should I be doing differently in my request body?
GET https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}/fields
to get the fields present for that item and you will see the right column name there how they are modified. In your case For '#' it is converted internally as 'x0023' that means for your field it becomes 'ExampleColumn_x0023_'. In the same way for space(' ') it converts to 'x0020'. Please go through this thread – Shiva Keshav Varma