Delete All Items from a List

  • 22 November 2017
  • 6 replies
  • 0 views

Badge +1

I am working on a workflow that is giving me trouble.  My intent is to start the workflow by deleting all the items in a list and then repopulate the entire list with new up to date data.

For the sake of argument let's assume the list contains 8,000 rows.

To delete all items I am...

1) Query List - All ID's in the list assigned to a Collection variable

2) For Each - For each ID in the Collection variable assign an ID to a variable

     2a) Delete Item - Delete the ID that was assigned to the variable in step 2

3) Additional steps to re-populate the data.

Does anyone have any experience trying to delete all items from a list on a schedule?  I know the Delete Item will delete a whole row if you delete the ID for that row.  I have tested that.  I can even do 100 at a time without a if I loop through a specific list of sequential ID's using a loop.  That obviously won't work as the ID's change as the list would get updated.

Logically I think my thought process is correct for how this should work but I must be missing something.  Does anyone have any ideas?  Is it possible that deleting more than 100 items is a restriction?  Any thoughts?  I can share my workflow if that would help.


6 replies

Userlevel 5
Badge +12

Hello,

Are you using on prem version of Nintex?  If so, did you know there was a "delete multiple items" action that does everything you described for you (as far as deleting items goes).

Thanks,

Mike

Userlevel 6
Badge +13

Also, may want to consider the overheads of doing this if you are talking about thousands of items being deleted and then created again.

Badge +8

Is it possible to simply update the data? Why do you need to delete all the records?

Badge +1

Hi Mike,

Do you know if the "delete multiple items" action returns more than 100 items that it will delete all of them?

Badge +1

Hi Roger,

In theory it's possible but because there are so many items it seems easier to just delete all the items and then repopulate the list with the most up to date info.

Userlevel 5
Badge +12

Hi Mark,

I've used it in the past to delete more than 100 items, but I'm sure the performance can vary on a number of things.   The whole delete/recreate method is pretty process intensive and time consuming.   When lists became much larger we've even turned to third party tools (such as layer2) to manage the list items in such a way, where it made more sense than having the workflow itself do it.   100 items isn't all that much in the context of a list so you should be fine... although do consider alternative methods if you feel the list will grow.

Reply