3

I'd like to update several items on a list through the rest api, this is how I update one item:

    update: {
        method: 'POST',
        contentType: "application/json;odata=verbose",
        headers: {
            "Accept": "application/json;odata=verbose",
            "Content-Type": "application/json;odata=verbose",
            "X-RequestDigest": function() {return  $("#__REQUESTDIGEST").val()},
            "X-HTTP-Method": "MERGE",
            "If-Match": '*'
        },
        url: "serverRelativeURL/_api/lists/getByTitle('ListName')/items(:ID)"
    }

Where ":ID" is the id of the list item

Is is possible to update multiple items, without doing this request in a loop for each item?

2 Answers 2

4

You can do that using batch request. Batch request is only available in SharePoint Online & SharePoint 2016. Find some useful references.

2
  • we're using 2013, but still useful, thanks
    – sch
    Oct 18, 2016 at 6:55
  • then you can go for JSOM. update multiple items and finally call context.executeQuery() Oct 18, 2016 at 7:01
0

I don't think it is possible without loop, at least based on the provided List and List Items REST API Reference (https://msdn.microsoft.com/en-us/library/office/dn531433.aspx).

Your Answer

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

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