Q: Updating Multiple List Items Using REST I have a SharePoint List in which I would like to update every relevant item's column value use REST API
I can update the information for each individual item given its ID, but I can not seem to figure out how to use REST to update them all.
Here is the code I have so far. If you know what I'm doing wrong or have any experience with this please let me know.
function Name() {
$.ajax({
    url: window.location.protocol + "//" + window.location.host + _spPageContextInfo.siteServerRelativeUrl + "/" + "_api/Web/Lists/getbytitle('ListName')/items?$filter=Name eq 'Name'",
    method: "POST",
    data: JSON.stringify({__metadata:{type: "SP.Data.ListNameListItem"},Column: "Value"}),
    headers:{   "Accept": "application/json; odata=verbose",
        "Content-Type": "application/json;odata=verbose", 
        "X-RequestDigest": $("#__REQUESTDIGEST").val(),
        "X-HTTP-Method":"MERGE",
        "If-Match":"*"
    },
    success: function (data) {console.log(data)},
    error: function (error) {alert(JSON.stringify(error));}
});}


A: Since this is SharePoint online, you can make use of the PnP JS core library. It contains a fluent API for working with SharePoint REST API as well as utility and helper functions.
To use that, simply add the pnp.js file's reference in your script editor/content editor/SP hosted app etc.
Once that is done, you can use the batch API to update multiple list items in a single call. This is quite fast but will work only in SPO.
The code for that is as below, do modify as per your requirements:
var list = $pnp.sp.web.lists.getByTitle("ListName");

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

    var items = list.items;

    items.filter("Name eq 'Name'").get().then(function(listItems) {

        var batch = $pnp.sp.createBatch();

        listItems.forEach(function(item, index) {

            items.getById(item.Id).inBatch(batch).update({
                Column: "Value",
            },"*", entityTypeFullName).catch(console.log);

        })

        batch.execute().then(console.log).catch(console.log)
    });

});

Secondly, you can also use the old school foreach loop which will work in both OnPrem and Online as below:
$pnp.sp.web.lists.getByTitle("ListName").items.filter("Name eq 'Name'").get().then((items) => {

    if (items.length > 0) { 

        items.forEach(function(item, index) {

            $pnp.sp.web.lists.getByTitle("ListName").items.getById(item.Id).update({
                Column: "Value",
            }).then(result => {             
                console.log(JSON.stringify(result));
            });

        });
    }else{
        console.log("no items found");
    }   
}); 

Install & Use - Getting started with PnP JS
Reference - PnP JS - working with list items
