Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Download from SFTP

Caleb
7 - Meteor

All,

 

I'm trying to determine if Alteryx can download files from an SFTP site. 

 

I've been searching the community and I came across this for download from FTP: https://community.alteryx.com/t5/Alteryx-Knowledge-Base/File-Transfer-Protocol-FTP-Download/ta-p/105...

 

Can I use this setup for SFTP as well? If not, is there a way to download from SFTP using Alteryx?

 

Lastly, if it is possible, can pull all files in the directory using \*.csv (as can be done with the Directory tool) or is a specific path required?

 

I saw a thread from 2015 talking about inability to upload to SFTP, not sure if that also meant download was also not possible at the time of writing.

 

Thank you in advance!

 

 

 

18 REPLIES 18
hda_wesleyjwk
7 - Meteor

Hi Caleb,

 

I have several flows that include downloading from SFTP using Alteryx. As always, many ways lead to Rome, so I'll show you my way.

 

First thing I do is set up a Text Input with the SFTP URL Folder I would like to download from.

Next I add a download tool, select the URL, encode the URL text, and output to a string field. In the connection I enter my credentials (username, password).

 

Afterwords I add a RegEx tool with Tokenize. I assume the files you are trying to download from the SFTP have some kind of consistent naming conventions or format that you could use to built a RegEx expression with to Tokenize them and split them to rows.

 

After this; given your requirements to look only for .csv's, you could add a filter that looks at rows that contain .csv and filter them out. Subsequently you could add back the SFTP URL with a formula that concatenates the SFTP URL and the filename you got from the RegEx expression. You could also add a output_to_url here which specifies the local folder you would like to download to (incl. the filename and extension).

 

This list of filenames and output_to_url's  you could input into a new download tool with the same set-up and credentials, only now you select that you want to write the output to a file from field "output_to_url".

 

Executing this workflow will retrieve all specified .csv's and download them to the folder specified by you.

 

Any more questions, just reply back. :)

 

 

 

 

 

 

Step 1 - Input SFTP Folder URL.jpgStep 2 - Download Folder Content.jpgStep 3 - Tokenize DownloadData.jpg

Caleb
7 - Meteor

Thank you!!

mattamidus
7 - Meteor

What is the delineation for a row in a csv file? 

imatjazz
5 - Atom

Hi,

 

This is great. Are you able to share your workflow?

 

Thanks,

imatjazz
5 - Atom
 
mattamidus
7 - Meteor

Does Alteryx support TGP encrypted files that are from an SFTP server?

MarkEugene9000
7 - Meteor

A way we have gone about it is to use Alteryx workflow to call the actual program WinSCP to sync up the SFPT contents with our own network. At the time, we were unable to figure out how to get a 'directory of files' via Alteryx from the SFTP. So we would use Alteryx to ask WinSCP to sync the SFPT with the network, and only then would Alteryx 'look for new files.' This seems like one of those things where it's only a matter of time before Alteryx makes it easier to achieve.

mattamidus
7 - Meteor

Alteryx already supports downloading files via SFTP.  You do it the same you would for FTP.  I'm just wondering if we can decrypt them as well.  I meant PGP encryption.  I suppose I can just do what yall did by calling the program that decrypts the file.  

nimeshkhatri
7 - Meteor

Hi, I have setup a workflow to download from SFTP. The workflow uses 2 download tools, one if for getting file names and parsing to select the one I am going to download. The second tool uses the full file path to download the file.

The process works fine on Alteryx designer. When I deploy it on server, the download tool throws the error 'Error transferring data: Couldn't connect to server (Tool Id: 9)'. The message as you know is of no use as it doesn't give more details than that. I am using GET as HTTP action.

Can someone throw light on what could be causing this failure?

Thanks

Labels