Skip to main content

I am creating a process that needs to delete all the items in a Sharepoint list before it copies an item from another list.  I see the tool that deletes Sharepoint list items, but it requires a listID.  So can K2 delete all the items or just one at a time??


 

Dave,


Normally this would be very easy.  Most wizards can take a repeating XML node or SmartObject list as a parameter and perform the requested operation once for each item.  Unfortunately, this wizard does not support that, but an enhancement request has been logged.


The good news is you can still do this easily using a little-know feature of blackpearl that allows an activity to behave like a foreeach loop.  I'll see if I can write something up or create a screen recording and post it.


David


Here is a recording that demonstrates one method using activity slots to iterate through a list to accomplish this task.  This example uses a SmartObject, but you could use a similar concept with the SharePoint Search Wizard and the SharePoint List Item (delete) Wizard.


I plan on posting a write-up on underground soon.


http://www.k2underground.com/files/folders/25499/download.aspx


David


Thanks for the demo on how to do this.  It will be very helpful.  I appreciate you taking the time.


Dave


This solution is a couple years old, is there an easier way?


I implemented this to delete some list items, and it works great when I have 10-20... but when I have over 100 SharePoint sometimes chokes and I get an error.


My thought was somehow processing 50 or so at a time, but I have yet to work out how to accomplish this.


Reply