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.

1
  • then you can go for JSOM. update multiple items and finally call context.executeQuery() Commented 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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.