cancel
Showing results for 
Search instead for 
Did you mean: 
m_mockert
Nintex Newbie

Create a certain amount of list elements

Jump to solution

Hi, we are using a list in SharePoint to manage our hardware. Now my colleagues had the idea, that it should be possible to add a specific amount of new items to that list with "one click". (to generate consecutive numbers for inventory labels)

The solution I created was very simple... the user can start the workflow, types in the "amount" of items that should be created, and the workflow runs...

- The Loop runs if the variable "amount" is greater than "0"

- then a new list item will be created with some defined single text columns

- then a math operation "subtract 1" from the variable "amount"

- the loops runs again if "amount" ist still greater than "0"

- and so on, and so on.

Workflow

It works fine, with only one problem... the loop takes so much time to run. (varies from 2 - 8min)

Is there any way to make this loop task faster? Because.... when my colleagues have to add/reserve 50 items the workflow would run 4 hours. Or perhaps there is another way to solve the request to create a certain amount of list items. (Quick Edit isn't the solution I prefer) 

Best Regards,

Marius

Labels: (1)
0 Kudos
Reply
5 Replies
Automation Master
Automation Master

Re: Create a certain amount of list elements

Jump to solution

Hi Marius,

please check if safe looping is enabled in your farm. You can enable/disable safe looping in Central Administration -> Nintex Workflow -> Global Settings

You can also disable safe looping for only one single workflow by doing the following:

  • Go to Central Administration
  • Disable Safe Looping globally
  • Republish your workflow
  • Re-Enable Safe Looping

Whenever you publish a workflow the current global settings will be applied.

Cheers

Philipp

Reply
Automation Master
Automation Master

Re: Create a certain amount of list elements

Jump to solution

if you want to avoid admin changes with every workflow publishing, you have (at least) two other options

- use for each loop instead of loop.

it's a bit tricky,, but you can find the concept described in following bolg post Safe Looping or Not--that is the question 

- make direct call of UpdateListItems method of List.asmx webservice. that gives you opportunity to build whole batch of as many rows as you need on your own, and submit it to sharepoint at once.

see web service reference with some examples here Lists.UpdateListItems Method (Lists) 

Reply
m_mockert
Nintex Newbie

Re: Create a certain amount of list elements

Jump to solution

Hi,

the global Setting for "Enforce Safe Loop" was the solution. Thanks for this advice.

@Marian: I checked your solution. It will surely get the job done, but is a little bit too complicated for this littel/simple request from my colleagues. But thank you, too. Smiley Happy

Regards,

Marius

0 Kudos
Reply
Automation Master
Automation Master

Re: Create a certain amount of list elements

Jump to solution

I'm just curious, how much time does it take now without safe looping for workflow to complete creating those 50 empty items?

0 Kudos
Reply
m_mockert
Nintex Newbie

Re: Create a certain amount of list elements

Jump to solution

I guess the creation of 50 items took about 7-10sec. I also tested it with 250 items... the workflow was running approx 30-45sec.

Reply