1

Is there any way to update bulk list items using REST API in sharepoint online site. Thanks in advance

2 Answers 2

3

In SharePoint Online, the Rest API does support batch operations. If you are using PnP then things will become easier for you in this regard:

Sample from PnP Documentation: Source

import { sp } from "@pnp/sp";

let list = sp.web.lists.getByTitle("rapidupdate");

list.getListItemEntityTypeFullName().then(entityTypeFullName => {

    let batch = sp.web.createBatch();

    // note requirement of "*" eTag param - or use a specific eTag value as needed
    list.items.getById(1).inBatch(batch).update({ Title: "Batch 6" }, "*", entityTypeFullName).then(b => {
        console.log(b);
    });

    list.items.getById(2).inBatch(batch).update({ Title: "Batch 7" }, "*", entityTypeFullName).then(b => {
        console.log(b);
    });

    batch.execute().then(d => console.log("Done"));
});
2
2

You can batch queries and operations against the REST/OData API of Microsoft SharePoint Online (and on-premises SharePoint 2016 and later) and the Files and folders subset of the Office 365 REST APIs.

The request URL consists of the root service URL and the $batch option.

For example:

https://fabrikam.sharepoint.com/_api/$batch

Or

https://fabrikam.office365.com/api/v1.0/me/$batch

Reference:

Make batch requests with the REST APIs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.