Introduction
In this article, we learn how to update a SharePoint List Item without increasing its item file version. We will be using the SharePoint REST API for this purpose.
Description
I came across one specific requirement that while updating document metadata fields like Title or Other fields, the version field should not be incremented.
If you know how SharePoint handles versioning for all document libraries, you are aware that even if you make smaller changes in updating Fields or content of the document, it increments the version of the document.
I have found a similar solution using CSOM over here Posted by Srikant Barik.
But we want a solution using the REST API. After some research, I have found the solution.
In Sharepoint Online, I have found "ValidateUpdateListItem" POST Endpoint at ListItem level.
- // Sample Request Url
- reqUrl= "https://brgrp.sharepoint.com/_api/web/Lists/GetbyTitle('Documents')/items(1)/ValidateUpdateListItem";
- //payload for request
- body= {"formValues":[{"FieldName":"Title","FieldValue":"Single Update Title with versioning"}],bNewDocumentUpdate:true}
In "formValues", you can add multiple columns as well to update items.
If you do not provide bNewDocumentUpdate value it will take default value false. This field is responsible for incrementing version or not for specific list item.
A false value indicates that it will increment the version of the file and True value indicates that it will not increment the version of the file or list item.
See Full Source Code
- //payload for request
- body= {"formValues":[{"FieldName":"Title","FieldValue":"Single Update Title with versioning__"}],bNewDocumentUpdate:true}
- //Header data for sharepoint POST Request
- var _payloadOptions = {
- method: "POST",
- body: undefined,
- headers: {
- credentials: "include",
- Accept: "application/json; odata=verbose",
- "Content-Type": "application/json; odata=verbose"
- }
- };
- //Get RequestDigest First
- fetch("https://brgrp.sharepoint.com/_api/contextinfo",_payloadOptions).then(r=>r.json())
- .then(r=>
- {
- _payloadOptions.headers["X-RequestDigest"]=r.d.GetContextWebInformation.FormDigestValue
- _payloadOptions.body=JSON.stringify(body);
- // Make REST API Call to update list item without increamenting version.
- fetch("https://brgrp.sharepoint.com/_api/web/Lists/GetbyTitle('Documents')/items(1)/ValidateUpdateListItem()"
- ,_payloadOptions).then(r=>r.json()).then(r=>console.log(r))
- })

Ano MepaniPosted Nov 26, 2020, 9:44 AM
No, I think, It should work regardless of a minor or major version. I didn't test for a minor version.
David VPosted Nov 25, 2020, 10:44 AM
Hi Ano, Thank you for sharing this. Unfortunately it works only when the item is in a minor version and NOT published, right ? David