You are viewing limited content. For full access, please sign in.

Question

Question

Delete Files that were Emailed

asked on March 22, 2018 Show version history

I have a workflow that generates a report in a folder on the WF server and emails it. Once the report is emailed, I'd like to remove it from the server to clean up after itself.

How would I do that? I'm sure I'd put it in the For Each File after the Email Notification. I just don't know what tool to use:

0 0

Answer

SELECTED ANSWER
replied on March 23, 2018

Gloria,

There are several ways to make this happen.  The first would be a scheduled PowerShell Script task that could be scheduled to run after business hours.   The second would be to code up a short script using the LF Workflow Script Activity and referencing the System.IO.File class to delete the specified files. The third way would be to use the Qfiche Toolkit File IO custom workflow activity.  This custom workflow activity was designed to do exactly what you want accomplished. 

Here is a screen snip of a bare bones workflow to delete the files specified by the For Each File activity;

 

The Qfiche Toolkit custom workflow activities are available for download from the Products page at http://qfiche.com/products.  All of the custom workflow activities are fully functional 30-day demo activities.

0 0
replied on March 23, 2018

Thanks! Went with Option 2:

System.IO.File.Delete(GetTokenValue("csvpath").ToString());

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.