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

share|improve this question
up vote 0 down vote accepted

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.

share|improve this answer
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"

share|improve this answer

I have written two workflows on codeplex - one is and one is

share|improve this answer

Your Answer


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.