Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


EduardW
2015-08-03T15:31:15Z
A big hi to VC-Team,

i'm new at VC and would be happy to get some help with a problem.

I want a process, that reads a directory with for example five files in it.
The aim in this example is to send five mails, each mail with another file as attachement.

In my attempt i create a mail-task with the directory in attachement data. Then the five files are listed semicolon-separated.
After this i set a loop for this task with following condtions:
For each row x in {TASK(4dc2bf23-8bf5-4f6f-a7ae-02a4bd2360b2,StdOut)} (-> this prints the file-list)

Result is a mail with all files as attachements.

Can anybody help me?
Thanks.
Sponsor
Forum information
Support
2015-08-03T17:12:18Z
Hi,

two Tasks are needed. First the List files Task which lists all files in the folder. Then add an Email Task. What you need to do is to put the Email Task in a loop and loop, with "for each"-method on value {TASK(PrevTask,StdOut)}. Then use the loop Variables and use as Variables in the attachment of the Email Task.

Check out the Loop tutorial here: http://www.visualcron.com/Tutorials.aspx 

What is special about this is that each row, in the loop will contain the full path. So, for source folder you need to combine the Variable with GetDirectory Variable and for file mask you use the GetFileName Variable. It will look like this:

Source folder: {PATH(GetDirectoryName|{LOOP(CurrentValueX)})}
Include file mask: {PATH(GetFileName|{LOOP(CurrentValueX)})}
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
EduardW
2015-08-04T09:30:30Z
Thanks a lot Henrik!

That sounds nice, but the result is still not the expected.
Result is only one mail with one file as attachement, but i can't explain why.
I follow your steps and and watch the loop-tutorial.

2015-08-04_112632.png 2015-08-04_112522.png 2015-08-04_112702.png

Thanks!
ErikC
2015-08-04T09:54:33Z
Hi EduardW,

Looks like the Tab File Seperator is not working properly here.
Try to use the CrLF in the List file(s) task and select it also in the loop.
That should work.

[EDIT]
The Tab should work though, set the Line break in the loop to: Tab. The Line break is used for the different records.
[/EDIT]

Regards
Erik
Uses Visualcron since 2006.
EduardW
2015-08-04T10:10:09Z
Hi Erik,

you're right! Thanks a lot to you and Henrik for quickly help!

Best regards
Eduard
Scroll to Top