1

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

3 Answers 3

1

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.

3
  • 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, 2012 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. Apr 26, 2012 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, 2012 at 17:08
0

There's a codeplex solution that covers this:

http://efspwfactivities.codeplex.com/

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

0

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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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