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
Assuming the lookup field name is docItem simply using
'docItemId':1
will do the trick.