SharePoint Looping Workflow – How to: Loop through and process all list items

SharePoint Looping Workflow

How to configure a workflow using SharePoint Designer and OOB workflow actions to loop through each item in a SharePoint list and perform calculations, processing and updates on each item. A number of lists and workflow are used to enable the looping functionality using standard SharePoint Designer workflow activities.

Installing Service pack 2 (SP2) or later for SharePoint may result in looping workflow functionality being lost, as “On Change” workflows won’t re-initiate a new instance of the workflow when the current item is updated. The method explained in this article to create looping workflows in SharePoint will work in environments with or without SP2 installed. This is achieved by configuring the loop control workflow to start when a new item is created with a specific value in the “title” field. When the “loop control” item is created, the workflow will initiate the next iteration of the loop by modifying the next item in the list to be processed . This will initiate the item processor sub-workflow that performs calculations, processing, etc. on the current item. Once the item has been processed, the final step of the “Item Processor” workflow is to create a new “Loop control” item, which results in the process repeating until all items in the list have been processed. The workflow will stop once all items have been processed, as it will not be able to find the a list item which matches the required criteria. A custom “Processed” column/field (Boolean) in the list containing the items being processed is used to find the next item in the list to be processed, and is updated to initiate the “Item Processor” workflow for the item.

SharePoint Looping Workflow

Related posts:

  1. Create (Looping) Timer Workflows Using SharePoint
  2. How to configure a workflow to start at specific time, then loop / repeat periodically (Daily, Weekly)
  3. How to wait for a change in any list, wait for multiple field changes in the current item (SharePoint Workflow)
  4. SharePoint Designer Workflow Error Resolutions & Workarounds

Comments are closed.