I am trying to save a list item in SP 2013 using REST API.
One of the fields, named AccessRights
, is a People or Groups type field.
My code works fine when I use this:
dataToSave["AccessRightsId"] = 46;
//add other fields
//post through REST API
However, I need to save multiple groups or people in this field.
Following this blog post, I am trying to send the request like this:
Instead of just group ID, I am trying to use an object that consists of the "results"
property that has an array of group IDs.
This fails with the following error:
Microsoft.SharePoint.Client.InvalidClientQueryException",
"message":{"lang":"en-US","value":"An unexpected 'StartObject' node was found when reading from the JSON reader. A 'PrimitiveValue' node was expected.
I've tried to use both string
and number
values in the array ("47" and 47), neither work.
What's the correct way to save multiple people or groups via REST API into a People or Group field?