SharePoint 2010 - Create liste items with looping workflow - limitation of 5?

Mike picture Mike · May 19, 2012 · Viewed 9.8k times · Source

I have a little problem creating new list items (rows) with the help of a workflow in a list in SharePoint Server 2010. Here are the facts.

What I want to do:

  1. Create an item in a main list. While creating this item, the user has to enter a number which specifies the number of list items that should be created in a secondary list.
  2. When the item in the main list is created, a workflow starts.
  3. This workflow should create the number of list items in the secondary list, that the user specified before.

What I have so far:

As I'm restricted to work with SharePoint Designer, I have no possibility to create a for loop (which, I have to say, is quite weak and annoying beacause it would simplify a lot of things). However, what I have so far is the following and it works to a certain degree:

  1. The workflow on the main list:
    • This one starts when an item is created or an existing one is updated.
    • It creates a new list item on the secondary list. Amongst others, it passes the ID of the item that was just created, the number of items which should be created in the secondary list, and a counter value (initial value is 1).
  2. The workflow on the secondary list:
    • Increases the counter value by 1
    • Saves the ID of the corresponding list item in the main list.
    • Saves the number of items which should be created in the secondary list.
    • And (if the counter is smaller as the items which should be created) updates the counter of the corresponding item in the main list (that's why I passed the ID before).
    • As the item in the main list is updated, the workflow starts again with the new counter value.

Actually, it's the same principle described in this forum contribution.

The problem:

Now here is the problem: Despite the fact that the loop works, the problem is that only a maximum of 5 items are created in the secondary list, but I never declared that anywhere. For example, if I create an item in the main list and I enter a number of 10, the counter stops at 5 and only 5 items are created in the secondary list. But if I enter a number that is lower than 5, everything works perfect. For example, if I want to create 3 items in the secondary list, it only creates 3 items and the counter stops at 3, as it should.

The question:

As I am quite new to SharePoint (I'm coming from the PHP/SQL-World, where - as you know - loops are absolutely no problem), my question is if there are any predefined limitations in regard of creating list items by a workflow, and if yes, how and where I could change them (if that is possible).

Answer

robbins4 picture robbins4 · Jul 24, 2012

This page says the limit of five is built in to reduce server strain and prevent infinite loops.

I can't find it now, but someone said this could be avoided by adding "Pause for Duration" for a minute as the last step of the looping workflow.