Alteryx Designer

Find answers, ask questions, and share expertise about Alteryx Designer.
Andy Uttley, Alteryx ACE, makes music with Alteryx | Math + Music

Use of Batch script file to upload file to a server

Highlighted
8 - Asteroid

I have an input data from the database that I would like to run on a particular date and the filename should be filename.dayof running the file.

The day the file is scheduled to run, the output file should be in a particular server location. The server has the credentials. How do I auto-schedule the file run and dump the data using a batchscript file?

 

Would appreciate your response.

 

Thanks. 

Highlighted
Alteryx
Alteryx

Hi @kmoon 

 

If I am understanding this correctly, you could do the following:

 

1.) Use a data input tool to query the database

2.) Use a formula tool to create a new column that is something like "C://users/username/desktop/filename."+DateTimeNow()+".xlsx|||Sheet1"

3.) Use an output tool to write the file. Make sure to check the box for Take File/Table Name from Field and select the column created in step 2

4.) Uncheck the Keep Field in Output option so that the column doesn't stay with your data in the output

5.) Use a block until done tool where the file output portion is coming out of the first output of the block until done so it executes first

6.) From the second output on the block until done tool, use a Run command that kicks off your batch script

7.) Leverage the file name in your batch script

8.) Done!

 

I'm not sure why you decided to use a batch file to send the file up to the server rather than uploading it using Alteryx, but you are welcome to choose either option. You may want to take a look at the following: https://community.alteryx.com/t5/Alteryx-Knowledge-Base/Upload-to-SFTP-FTP/ta-p/20845 

Highlighted
8 - Asteroid

Hi @BrandonB ,

 

I tried the link you forwarded. I land up in some error.

 

Based on the type of problem I described to you, could you provide a demo batch script command to upload the file to a server with authentication?

 

Would appreciate your help.

 

Thanks.

Highlighted
Alteryx
Alteryx

Hi @kmoon 

 

Not sure why the link isn't working for you, but it navigates to the "Upload to SFTP/FTP" article on our community that you can search for from the global search bar. As for the batch file example, I would normally use the download tool within Alteryx to upload to a SFTP. A batch file is external from Alteryx and needs to be written specifically to address your company's environment. 

 

 

Highlighted
8 - Asteroid

Hi @BrandonB ,

 

I meant I tried the link but couldn't figure out the way.

So If I write down any data from database, using the SFTP link, is it going to upload to the desired server?

 

Thanks.

Labels