Page 1 of 1

Generating a list of processed files

Posted: Tue Oct 27, 2015 9:45 am
by jwawrzon
I have a process set up that grabs a bunch of files from a server via sftp, runs them through a loop that unzips each file and creates a new directory to unzip it into. The loop then emails the user for each file (the output file variable) that was unzipped. This ends up sending out a bunch of successive emails to the users instead of one email with all of the files that were processes.

Is there a way to take the output file variable and append it to a file list, then send that entire list out in a single email?

Re: Generating a list of processed files

Posted: Tue Oct 27, 2015 10:27 am
by Support_Rick
Create a var before getting into your loop (ie, something like MyZipFiles) and initialize to ${system.emptyString}

Inside your Loop, Just append the file name to MyZipFiles as you go through the loop. Something like:

SetVar ${MyZipFiles} = ${Concat( MyZipFiles, ThisFile:name, system.carriageReturn )}

Then, print ${MyZipFiles} inside your email at the end.

Re: Generating a list of processed files

Posted: Tue Oct 27, 2015 11:26 am
by jwawrzon
Thanks Rick. This worked perfectly.