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


Robbanz
2015-08-25T20:50:45Z
Hi

i'm trying to set up a task that will upload a file from a folder located on one of my servers to my ftp and then Writing the uploaded filename to a sql table.

upload works great and im using a notification that is fired in the flow tab on success
INSERT INTO Filelog(Filenamn, Date) VALUES('{TASK(PrevTask,StdOut)}', '{DATEFORMAT(yyyy-MM-dd HH:mm:ss)}')

im using the same thing on a server at work (version 5.7.5) and there every uploaded file generates a record in the sql table

Now in version 7.7.4 which im using on a trial licens at home Before upgrading the licens at work all files are uploaded but only generates one record containing every filename that I uploaded.

is it still possible to generate one record for each file uploaded?
Sponsor
Forum information
ErikC
2015-08-25T20:55:41Z
Hi Robbanz, welcome to the forum!

What you can do is using the output {TASK(PrevTask,StdOut)} in a loop and use the sql statement in a loop.
The SQL query should contain the currentX value for the filename, not the {TASK(PrevTask,StdOut)} anymore.

Regards
Erik
Uses Visualcron since 2006.
Robbanz
2015-08-25T21:17:33Z
Hi ErikC,

that was a Quick reply.

so i just change to using a loop with the ftp task as the start and a second sql task have been added as the finishing task in the loop.

In the loop settings im using "for each x in {TASK(PrevTask,StdOut)}" and all files are uploaded correct to the ftp.

i also changed the sql statement to below:
INSERT INTO Filelog(Filename, Date) VALUES('{LOOP(CurrentValueX)}', '{DATEFORMAT(yyyy-MM-dd HH:mm:ss)}')

I tryed uploading 14 files to the ftp but i only get one record in my table and it's not a filename.
[Task does not exist or is not selected.]
Ohh just got it, the loop was only supposed to be in the second statement, now verything works just as i wanted!

Thanks for the help ErikC!
Scroll to Top