I am new to share point, and I am trying to get my workflow to update every item in a list that match a particular expression. for instance lastname = 'smith'. From my understanding the update item activity will only update the first item found that matches that expression. This leaves me to believe i need to create a custom Activity in C# and then import it into SharePoint.

Is this correct? Is there a better way to accomplish this, that can be reused in multiple places easily? Does Anyone have any code that will help me get started in creating a custom activity? Has this custom activity already been created somewhere else? Any help would be appreciated.

Edit-As pointed out below in the answers I can create a looping workflow but I would like to write a solution that can be reused easily. I think a custom workflow action is the way to go, so I am looking for help with that. Thanks


You are correct in that it will only update the first occurance.

Here is a good post explaining what you need to do, it's detailed to explain but simple to implement. The workflows basically trigger each other and execute the loop until no matching conditions occur.

Another alternative, if you don't want to write code, is to purchase Nintex Workflow or K2 or similar workflow tool that bolts onto SharePoint where looping actions are available.

  • Thanks for the quick response. We were hoping to write a solution that can be reused easily, which is why I am thinking about writing my own custom action. I guess I should edit the question to say I need help getting started on creating a custom action. – kds6253 Apr 26 '12 at 16:45
  • My philosophy is don't write code unless you need to and here is a method so you don't have to. – Eric Alexander Apr 26 '12 at 16:46
  • another issue with your solution is if I am updating a lot of records in the list, upwards of 10,000 your solution is not the most efficient way. that is why I am looking for a code based solution – kds6253 Apr 30 '12 at 17:08

There's a codeplex solution that covers this:


It contains a workflow activity named "Update Item by CAML"


I have written two workflows on codeplex - one is https://rwomi.codeplex.com and one is https://umlisdw.codeplex.com/

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.