SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

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.

 


Posted 07-26-2007 1:43 PM by Jeff Holliday

Comments

Links (7/26/2007) « Steve Pietrek’s SharePoint Stuff wrote Links (7/26/2007) « Steve Pietrek’s SharePoint Stuff
on 07-26-2007 7:10 PM

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

Jayaraj wrote re: Delete Files with Workflow Using Duration
on 07-31-2007 2:19 AM

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

Tintas Barnes wrote re: Delete Files with Workflow Using Duration
on 09-03-2007 5:25 AM

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?

Tintas Barnes wrote re: Delete Files with Workflow Using Duration
on 09-03-2007 5:27 AM

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

spex wrote re: Delete Files with Workflow Using Duration
on 09-18-2007 8:47 AM

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 ?

Paul wrote re: Delete Files with Workflow Using Duration
on 06-17-2008 1:22 AM

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!

Prabhakar wrote re: Delete Files with Workflow Using Duration
on 08-19-2008 12:05 AM

Hey Paul,

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

my Email: prabhakarannet@gmail.com

RMSUG Presentation ??? Workflow References, 11/18/08 « Greg DeRoeck’s Weblog wrote RMSUG Presentation ??? Workflow References, 11/18/08 « Greg DeRoeck’s Weblog
on 11-18-2008 5:57 PM

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

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.