in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

The SharePoint Redemption

Saving Us from Collaboration Hell

Delete Files with Workflow Using Duration

This is just a quick little tidbit.  Out-of-Box workflows in MOSS, unless manually kicked off, require an event to be triggered.  I was trying to figure out a way to automatically delete files from a document library 3 days after they were uploaded.  The doc library was being used strictly as a transfer point and needed to be kept clean.  Thanks to Sean S. for the idea...

So as simple as it is:

1.       Start a new workflow using SharePoint Designer by going to File -> New -> Workflow.

2.       Give the Workflow a name and select the target doc library or list.

3.       Set the start event.  I set mine to automatically start when the item is created or changed.  Click Next.
Step 3

4.       Enter a name for Step 1 such as ‘Pause for 3 days’

5.       Do not select a condition because we want it applied to all items.

6.       Under Actions select ‘Pause for duration’.

7.       Change to 3 days, 0 hours, and 0 minutes.
Step 7

8.       On the right choose to ‘Add workflow step’
Step 8

9.       Once again, give the step a name and no condition.

10.   Select Delete Item under Actions and set it to Current Item.
Step 10

11.   Click Finish to save the workflow.

NOTE: A good way to test this first is to set the duration to a low count like 1 minute.  Once you are sure it works properly, set it to your desired time frame.

 

Comments

 

Links (7/26/2007) « Steve Pietrek’s SharePoint Stuff said:

Pingback from  Links (7/26/2007) « Steve Pietrek’s SharePoint Stuff

July 26, 2007 7:10 PM
 

Jayaraj said:

I need some information. How do we delete files by using sharepoint dynamcally? For example, following URL is Upload the files to Sharepoint

msdn2.microsoft.com/.../ms868615.aspx

same as above , i want delete the files from sharepoint

July 31, 2007 2:19 AM
 

Tintas Barnes said:

Hi!!

I have a problem :(... For me its HUGE but for You probably is small. How can I attach a new column for a document library in Sharepoint in wich I can see how many times a document is opened?

September 3, 2007 5:25 AM
 

Tintas Barnes said:

my email is tintasbarnes@gmail.com if you can gove me some help...

September 3, 2007 5:27 AM
 

spex said:

The "Delete ITem" in my lib is set to "Current Item" , but I get  "Error Deleting Item" - Unknown Error.

The workflow cannot delete "Current Item"

How do I troubleshoot that ?

September 18, 2007 8:47 AM
 

Paul said:

I created an extra column in a document library called "expiry date"

users upload and set an expiry date.

i want the document deleted from the library once the document is expired.

How do i do this?  Help guys!

June 17, 2008 1:22 AM
 

Prabhakar said:

Hey Paul,

                       Did you get any answer for "Document deleted from the library once the document is expired"

my Email: prabhakarannet@gmail.com

August 19, 2008 12:05 AM
 

RMSUG Presentation ??? Workflow References, 11/18/08 « Greg DeRoeck’s Weblog said:

Pingback from  RMSUG Presentation ??? Workflow References, 11/18/08 « Greg DeRoeck’s Weblog

November 18, 2008 5:57 PM

Leave a Comment

(required )  
(optional )
(required )  
Add

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts