Question

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

Was it helpful?

Solution

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.

OTHER TIPS

There's a codeplex solution that covers this:

http://efspwfactivities.codeplex.com/

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/

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top