Alteryx Designer Desktop Discussions

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

Download tool error macro

karan1107
7 - Meteor

Hello community,

 

I need to download a file from SFTP which have dates present in the URL.. I am able to download if the file is present on SFTP, but if not, I want a loop to start and continue looking( a day before and so on) till it finds a file. The download tool gives an error "File not found" and stops the workflow. Can anybody help me to work with error handling. How can i ask Alteryx to start an iterative macro only if there is an error in the download tool. Example : the sftp does not have files for 9th and 8th Feb. if a user enters 9th Feb, since the file is not present, it should look for a day before(8th Feb), 8th feb is also not present, so it should look for 7th Feb and then give me the file.

3 REPLIES 3
danilang
19 - Altair
19 - Altair

Hi @karan1107 

 

If your begin your process with a call to get the list of file names in the directory in the FTP site, you can use this list as a filter to ensure that you're never trying to do download a file the doesn't exist.  Just use sftp://URL/Directory as the initial url, replacing URL and Directory with the correct values of the site name and directory path, respectively.  This will return a list of existing files.  Join this list with the list of files that you want to download and use the J output as the input to your main Download tool

 

Dan    

karan1107
7 - Meteor

Hi.. Thanks for the reply.. this is what i did eventually. But was still wondering, how do you work with errors in Alteryx.

danilang
19 - Altair
19 - Altair

@karan1107 

 

There is no error trapping mechanism in Alteryx.  Most of the time, the best strategy involves setting up your workflow so the error doesn't occur, as in your case.  In some cases, you can put the tool inside a macro and call it repeatedly.  This will work with some type of errors, but not all. 

 

Dan 

Labels