Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'PrimitiveValue' node with non-null value was found when trying to read the value of a navigation property;

How can I save document library lookup field using REST API Post in a SharePoint list? I tried like

'docItem':'1;#test'

But, it is throwing an error :

{
  "error": {
    "code": "-1,Microsoft.SharePoint.Client.InvalidClientQueryException",
    "message": {
      "lang": "en-US",
      "value": "A 'PrimitiveValue' node with non - null value was found when trying to read the value of a navigation property;however, a 'StartArray' node, a 'StartObject' node, or a 'PrimitiveValue' node with null value was expected."
    }
  }
}

Bad Request

like image 861
Praveen Prasannan Avatar asked Jan 12 '23 09:01

Praveen Prasannan


1 Answers

Assuming the lookup field name is docItem simply using

'docItemId':1

will do the trick.

like image 196
Aleksi Niiranen Avatar answered May 01 '23 07:05

Aleksi Niiranen