Set and Clear Person Column Values Using SharePoint REST API

This post will show you how to update a Person/Group column value in SharePoint using the REST API, including how to clear/empty the value in the columns.

Setting a Person/Group Value

If you want to set a Person or Group column value using SharePoint’s REST API, there are a couple of things you’ll need to do. First, you’ll need to include the correct standard headers, including a X-RequestDigest value, If-Match header for consistency, Content-Type and Accept headers (easiest to use JSON for both), and X-HttpMethod. Here is a raw set of headers:

…and a jQuery ajax example:

Next, the name of the column in your update is not the same as the actual column name, so you’ll need to append “Id” to the end of your column. For example, if your column name is “Requestor”, you’ll need to use “RequestorId” in your request body. Below is the raw body of a POST request updating both a single-value person column, and a multi-value person column. Notice the single-value column takes an integer ID value – this is the numeric ID of the user in SharePoint from the UserInformation list in the site collection. Also notice the Multi-value columns syntax, which requires an array object to be passed to it:

Clearing Person/Group Values

To clear out or empty the values in person or group columns, how you do it depends on if the column is single-value or multi-value.

For single-value person columns, all you have to do is set the value to -1.

It requires an integer value, so null or empty string will give you an error: Cannot convert a primitive value to the expected type ‘Edm.Int32’.

For multi-value person columns, you have to set the results value to an empty array:

That’s it!