0

I would like to use UpdateListItems or something similar to allow my users to pass in some variable (e.g., a name) so I can use a caml query to find all items where SomeUserField = 'John B Smith' and replace that field with the value that they enter.

I see here: http://spservices.codeplex.com/wikipage?title=UpdateListItems that there is an "ID" parameter which makes it seem like I can only use this to update a single item.

Is it possible to have this change happen for all items where that query is true using only JavaScript/jQuery?

1

To do a batch update query where the IDs are not known, you need to use this action: SPUpdateMultipleListItems.

Example from the documentation:

$().SPServices.SPUpdateMultipleListItems({
  listName: "States",
  CAMLQuery: "<Query><Where><Eq><FieldRef Name='Status'/><Value Type='Text'>Active</Value></Eq></Where></Query>",
  valuepairs: [["Status", "Inactive"]]
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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