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

Question

Question

How can I create and attach a csv or spreadsheet pouulated with a list compiled for email distriubution

asked on September 29, 2015

Hi All,

I have seen numerous posts on answers that point me to either the SDK, Scripting or other means of creating and manipulating entries - but none seem to really tell me the simplest way to attack my problem.

In essence it is very simple, since i have already completed an email report that calculates a number of tokens and two lists of documents and displays them in an email with simple HTML formatting for auditing purposes.

Simple example:

(1) ID: 12345, Name: FileA

MyRepository\Folder1\Subfolder1\FileA

(2) ID: 78987, Name: FileB

MyRepository\Folder2\Subfolder3\FileB

etc...

The Token composition is by doing the modification of a created token and modifying it with an append "for each entry" in a search loop.

 

Consequently I end up with a nicely formatted email that has a list of the files.

By using colour and bold, underline etc I have made it reasonably easy to parse but it cannot be sorted or compared one day to the next as it changes and the best way to do this would be to attach a csv text file to the email with the same token data populated with comma separated formatting.

eg in email:

 

(1) ID: 12345, Name: FileA

MyRepository\Folder1\Subfolder1\FileA

(2) ID: 78987, Name: FileB

MyRepository\Folder2\Subfolder3\FileB

 

...and in attached csv/text file:

1,12345,FileA,MyRepository\Folder1\Subfolder1\FileA

2,78987,FileB,MyRepository\Folder2\Subfolder3\FileB

 

As I understand, it this would probably have to be done with a script in the workflow, is that right?

I am not able to do this with Visual Basic etc as it exceeds my expertise.

I would have thought it might be possible to create an entry in a special folder of the repository and write the list to that and then attach that entry to the email but I can't seem to do that either...

 

Any pointers guys please?
Best regards,

Will

1 0

Answer

SELECTED ANSWER
replied on September 29, 2015

Creating the CSV file would be done through a script or custom activity.  You would have to first create a string object that holds all the text of the csv and then once the string is complete, write it to file.  As writing text to CSV is not a Laserfiche function, it is not covered by the the LF SDK.

Use a StreamWriter object to write the content of your string object to file.

If you are looking to hire someone to create a Workflow activity for you to handle this task, contact Cliff Primmer at cprimmer@qfiche.com.  Cliff is a Laserfiche development partner who specializes in Workflow custom activities.

 

1 0

Replies

replied on September 29, 2015

Will,

Are you intent on creating a CSV attachment or would you consider a workaround?  It sounds like you can already format the token values into a CSV like format correct?  Why not just add the CSV formatted text to the end of the HTML formatted text in the body of the email (or send a separate email with only CSV formatted text in the body). 

The end user only has to open the email, copy and paste the CSV formatted text to a single column in Excel, select the column, then from the Data tab click on the 'Text To Columns' option.  That starts the CSV import wizard on the selected column text.

If you want to pursue the creation of a CSV file then I believe there are script examples available in other Answers posts that can be used as a starting point for what you are trying to accomplish.

You are welcome to email me at cprimmer@qfiche.com if you need additional assistance.

2 0
replied on September 29, 2015

Thanks Bert and Cliff,

It is as I thought. 

And yes, I had already considered putting a snip block in at the end for cut n paste to a spreadsheet - I'll see if the client is happy with that, but the idea is to automate as much as possible and they are likely to see this as a bit too much of a fiddly workaround, then again, I could set up a table and start appending the daily/weekly results to that and they could really work with it.

In the end it has to be part of an audit process that is robust and complete and gives them compliance with some of their internal audit requirements around OCR completeness/deep text searchability across the entire repository.

 

Thank you gentlemen.

Will

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

Sign in to reply to this post.