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


Necronomecon
2015-04-24T14:50:51Z
Dear all,

I have a question regarding the loop functionality.

I have a list abc.txt with an undefined number of list entries, e.g. 3 entries for the example
abc.txt
ZZZZ9345
Z0200201
Z030DFGS

I want Visual Cron to go through this list line by line and upload files with identical names which are stored on a share via SFTP to an external party.
This is what I've tried:
1. I created an upload task pointing to the share mentioned with the "Include file mask" {LOOP(CurrentValueXArray,0)}. ( I also tried {LOOP(CurrentValueX)} and {LOOP(CurrentValueXLine)} )
2. I created a loop on this task"For each x in y" and {FILE(Content|D:\abc.txt)}. When I open the "Variable Browser" and insert this line, I can see the three lines of abc.txt

However, when I execute the task, no files will be uploaded to the external party? Could someone please tell me what I'm doing wrong?
I already watched the video on YouTube https://www.youtube.com/watch?v=hSPLLvBU2Ts  which explains loops as well as tried to find a solution in the forum, but I didn't find one. From my point of view the video tutorial deals with the same topic.

Any suggestions?

Thank you in advance and have a good weekend!
Sponsor
Forum information
Support
2015-04-25T09:02:05Z
It is maybe you you have split the file list. Open the Loop settings and add a screenshot here.

You can also try, to simplify, instead of upload, just write the value to a file. Then you will see exactly which value is used at that moment.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Necronomecon
2015-04-27T09:27:31Z
11-21-15_Add Task Loop.jpg

When I try to write the output in a TXT file, I get this result:
[Current context (running Task) is not in a loop]
Support
2015-04-27T09:56:45Z
Look at the main settings of the Loop. Perhaps you are not covering that Task.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Necronomecon
2015-04-27T10:18:23Z
I added both pictures of the main settings.
First one is the test job containing write to file. Second one is the job I want to implement
12-17-27_Add Task Loop.jpg
12-17-15_Add Task Loop.jpg

BTW: Is it possible to get remote support on this topic? We have a valid maintenance contract as far as I know.
Support
2015-04-27T10:29:25Z
We would really like to save time by solving it here first.

1. Use a local path to the file that you read to make sure it can be read by the server
2. I see you are using Tab(?) as new line - is that really true for the file?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Necronomecon
2015-04-27T10:55:10Z
1. I switched to local path, but same result: [Current context (running Task) is not in a loop].
2. I was using Tab because I was playing around with the settings.

Screenshots of the Test-Task that you don't get confused. Let's try to write in the test file first.
12-49-55_Variables.jpg 12-50-03_Add Task Loop.jpg 12-17-27_Add Task Loop.jpg 12-54-27_AddEdit Task - Write file - 1010.jpg
Support
2015-04-27T11:07:06Z
I made a quick example of exactly what you are doing. Please compare it with what you do to see what you are doing differently:

http://screencast.com/t/HwbDFrqibk 
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Necronomecon
2015-04-27T11:53:40Z
Thank you for your tutorial. That's exactly what I did. When I run the job itself, output is written to the output file. When I run the single task, I get [Current context (running Task) is not in a loop] :-)

I didn't know that I need to run the job and cannot run a single task.
Support
2015-04-27T12:04:16Z
Originally Posted by: Necronomecon 

Thank you for your tutorial. That's exactly what I did. When I run the job itself, output is written to the output file. When I run the single task, I get [Current context (running Task) is not in a loop] :-)

I didn't know that I need to run the job and cannot run a single task.



Yes, the reason is that Loops are part of a Job rather than Task.

Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Necronomecon
2015-04-27T12:24:51Z
two further questions regarding the upload of files.

1. how to specify wildcards within the for each loop as the list file is named SivantosPic_DDMMYYYY?
I tried {FILE(Content|D:\01_Data\Areva\SivantosPic*)} but doesn't work => [File D:\01_Data\Areva\SivantosPic* does not exist]

2. how to specify wildcards within the Loop file mask as the files to upload are named like this: ZXXXXXX_XXXXX_XXXX.jpg
I tried {LOOP(CurrentValueX)_*.jpg} but didn't work. I think I have to concatenate somehow the Loop variable with a string variable, but to be honest I didn't get the clue of the variables so far

I would be very happy if you can help with this issue.

Thanks in advance!

Necronomecon
2015-04-27T12:34:44Z
already solved my first question => {FILE(Content|D:\01_Data\Areva\SivantosPic_{DATEFORMAT(ddMMyyyy)})}
thomas
2015-04-27T13:50:05Z
Try putting the filextension outside the bracket, something like this: {LOOP(CurrentValueX)}.jpg
Necronomecon
2015-04-27T14:11:13Z
Easy solution 🙂 Thanks brother!!! You made it!

Have a good day!
Scroll to Top