How to update editor and author fields with REST API?

How to update editor and author fields with REST API?

The sample below updates the Editor and Author fields on SharePoint on-premises (SP2016 and SP2019) without increasing item version. The REST API ValidateUpdateListItem () on the ListItem object is much easier in providing the Person field values to update.

How to update editor and author fields in listitem?

My issue was to update Editor and Author fields for a listitem on SharePoint on-premises (SP2016 and SP 2019) without increasing item version. Both Editor and Author are People and Group (Person) field. According above blogs, you can set the Person field, like:

How to update author and editor at the same time?

Update Author and Editor at the same time for the first version only or Final file without versions. Use Web.EnsureUser method to get the User object and then use that to update the Author https://msdn.microsoft.com/EN-US/library/microsoft.sharepoint.client.web.ensureuser.aspx

How to update the created by ( authorId ) field?

The AuthorId field contains a numeric value (ie: 11) which is used to populate the Created By person data. Our end goal (soon)– to simply update this field to the numeric value of the user we want listed in the Created By column. First we need to get our replacement numeric value from somewhere.

How to update person or group field using REST API?

To do so, you would need to query the following REST request: Where [your user login] would be something like domain\ser. Remember also to correctly fill up [your domain] & [your site]. The JSON returned contains a field named Id. You’ll need that value for composing the JSON you are going to send to the server endpoint:

How to update file metadata with REST API?

Update list items without increasing its item version (see this blog for details). Easier to update some types of metadata, like Taxonomy, People and Lookup fields (mentioned in Robert’s blog ). Besides Robert’s blog, Andrew’s blog also presented detailed info about how to set various types of fields with ValidateUpdateListItem ().

How to update the person or Group Field?

Let say, Person or Group Id is 11 and internal name of the field is PersonField. So the request will be PS: Don’t forget to add Id with the field’s internal name.