Alteryx Designer Desktop Discussions

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

Challenging response from API / Download Tool compatibility

bryanbumgardner
8 - Asteroid

I'm using an API that, after authentication, provides a direct download link to a data file. That download link, if posted in a browser window, opens a "Save As" dialog box for the file.

 

Is there a way I can use a connector to automatically open this file in Alteryx straight from the link? 

 

The users don't want to run the API call, manually save the file, then put it into further processing. 

5 REPLIES 5
dataMack
12 - Quasar

Yes there is - here's how I do it:

 

1. Assuming you have some kind of a text input tool upstream of the first download tool which retrieves the location, add a column (let's call it tempFileSave) and put in the path to a location where the data file can be downloaded.  Let's assume your data file is a .csv, so i'd enter C:\temp\mydatafile.csv

 

2. Create another download tool, downstream of the first one that returns the download file location.  Configure it so that the URL field is the location returned from the first download tool, and then check the option to Output to a temporary file taking the filename from a field (the field you set up in step 1)

 

This setup will cause Alteryx to call the location and save the file.  Assuming you want Alteryx to continue the processing, here's what you do next:

 

3. Add a Block until done tool after the second download tool.  We're going to use this to ensure the entire file is downloaded and saved to the temp location before Alteryx continues its processing

 

4. Wire a Dynamic Input tool to the #2 output from the Block Until Done tool above.  Set the Dynamic Input tool to 'Read a List of Data Sources'- the field will be the 'tempFileSave' and the Action is Change Entire File path.  For the template, open a data file you have previously downloaded - this is only so Alteryx will know what fields to expect.

 

Thats it!  You'd then continue the processing of the data set from thereSNAG-0013.png

bryanbumgardner
8 - Asteroid

This is great! Thank you.

 

A confounding variable: What if the link provided by the API directs to a download of a .zip file?

 

I'm poking around the Alteryx documentation but can't figure out a clean fix. 

dataMack
12 - Quasar

Since 10.5 Alteryx can input a zip file as an input- they key is that if there are more than 1 file in the zip they need to have the same layout.

Raghu_s
8 - Asteroid

@dataMack thanks for the inputs. Am new to using the download tools for such tricky request. the concept of using two download tools is little confusing without having a sample work flow. Can you share some? 

 

As @bryanbumgardner pointed out, am trying to use this layout to download a zip file. 

 

Problem statement: So I hit a https link which is secure to download a file.  The link redirects to a portal which requests for a username and password and upon entering the values, a zip file downloads automatically. This is a manual task which am trying to automate. Though I have used download tool to grab file from secure FTP sites, this particular HTTPS request seems to be challenging. 

 

Upon trying to use the tool, all I get is a HTML code of that particular page where am not able to find the file location specified. 

 

Any thought would be of great help. 

Raghu_s
8 - Asteroid

Hey were you able to succeed in this? Kindly share a sample workflow if you have achieved any workarounds. badly looking for this piece to complete year end! 

 

:) 

Labels