SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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

share|improve this answer
    
we're using 2013, but still useful, thanks – klskl Oct 18 '16 at 6:55
    
then you can go for JSOM. update multiple items and finally call context.executeQuery() – Atish Dipongkor Oct 18 '16 at 7:01

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).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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