Download Tool

Use the Download tool as an alternative to the limitations of file formats and data sources. Since most data sources have an API, you can use the Download Tool to transfer data via the API of the data source. Here are some things you can do with the Download tool:

  • Connect to any HTTP based-service including FTP and SFTP
  • Connect to HTTP-based resources, such as REST APIs
  • Web Scrape by using one or more URLs

Visit the Alteryx Community Tool Mastery series to learn even more about this and other tools.

Alteryx public gallery compatibility

Planning to publish your workflow to gallery.alteryx.com? You must first apply for an exemption. This restriction does not apply to private instances of Alteryx Server and Alteryx Gallery.

Configure the tool

Use the Basic tab to set the mandatory controls for the Download tool.

  1. URL Field: Specify the field from the incoming data stream that contains the URL (Uniform Resource Locator - Internet resource) to pull data from (or upload data to). This could simply be a Text Input Tool where the URL is specified as a field value.
  2. Encode URL Text: When checked, the specified URL will be encoded as needed where unsafe ASCII characters are converted into a format that can be transmitted over the internet. An example of this would be the substitution of %20 for a space.
  3. Output: Specify how the returned data should be formatted. The data can be returned in a data field or output to a file.
    • To a Field: Downloaded content is returned in the data stream as a data field. The downloaded contents will be in a single field called "DownloadData". You will likely have to parse this data using downstream tools such as the Text To Columns Tool, RegEx Tool, or Formula Tool.
      • String: Data is returned as a new wide string type field. A wide string supports Unicode® characters.
      • Select one of the Code Pages to use for encoding. Default is UTF-8. For the most consistent results, applications should use Unicode, such as UTF-8 (code page 65001) or UTF-16, instead of a specific code page.

      • Blob: Data is returned as a new blob type field. Blob is also known as Binary large objects. Image files are usually stored in this format. To use the image, configure am Image Tool downstream and specify Image or Blob field.
    • To a File
      • Temporary File: Data is output to a temporary file and will be located in the user's temporary directory. For more on temp file handling in Alteryx, see Alteryx and Temporary Files.
      • Filename from a Field: Data is output to a specific file where the file specification is in an incoming field. Use the dropdown to select the field that contains the file name to output to.

Use the Headers tab to modify the HTTP headers sent with the web request.

  1. Add from the following constant values: Allows for adding fixed header values.
  2. To add the header "Accept: text/plain", enter "Accept" in name and "text/plain" in value.
  3. And values from these fields: Takes values from the record data and creates header values.
  4. For example to add the header "Expect: 100-continue", select a field from the input data named "Expect" that contains "100-continue."

Use the Payload tab to set the HTTP Action you would like to perform and optionally build the Query String or Body for the web request.

  1. HTTP Action: Select the HTTP Action for the web request. Choices include:
    • GET (or FTP): Perform a GET request or download a file from an FTP or SFTP site. This option can be used without entering any other options on this tab and will download the selected URL.
    • POST: Performs a POST request to the selected URL. Typically when using this option you would specify a POST body using the below options.
    • PUT: Performs a PUT request. This option only allows you to take the query body from a blob field via the Blob Input Tool. Typically used to upload a file to the remote server.
    • DELETE: Performs a DELETE request. Typically used to ask the remote server to delete a specified resource.
    • HEAD: Performs a HEAD request. This asks the sever to return the header data, but not the body data.
    • Custom: Allows you to enter a custom verb in a text box. Everything else about this request behaves the same as a POST. The POST verb is replaced by the custom verb just before the request is made.
    • Verb support

      These options only work if the remote server that you are sending the requests to supports a particular verb. Check the API documentation of the URL you are using to see what requests are supported.

  2. Choose from the following Query String / Body Options:
    • Compose Query String/Body:
      1. From the Following Constant Values: Adds constant name value pairs to the query string/body
      2. And values from these fields: Takes name value pairs from the incoming data record. The field name is the name used in the Query String/Body
      3. Content-Type: Controls how the name value pairs are encoded.
        • Application/x-www-form-urlencoded: e.g. Name1=Value1&Name2=Value2&Name3=Value3. Unsafe ASCII characters are automatically encoded, so make sure your data is not already encoded.
        • Multipart/form-data: Only available when using HTTP Actions POST and Custom.
    • Take Query String/Body from Field: Select the field in the input data which contains the Query String/Body data. Blob fields can be selected when using HTTP Actions POST, PUT and Custom.
    • Use Following for Query String/Body: Text box allowing you to manually type in the Query String or Body contents.

    All text data is UTF-8 encoded before being sent to the remote web server.

Use the Connection tab to set up connection credentials.

  1. Username: Enter the user name if required by the URL specification above. This is an optional field.
  2. Password: Enter the password if required by the URL specification above. This is an optional field.
  3. Maximum Connections: Specify the maximum number of simultaneous transfers for the Download tool to perform. Transfers are only done in parallel when there are multiple input records sent to the Download tool. Multiple Download tools operate independently, but do not typically function at the same time. For new Download tools added to a workflow, the default number of connections is 2 and the maximum number of connections is 32.
  4. Increasing the number of connections may reduce the total time taken to complete all transfers, but please use caution not to set the number too high as it could overload the server being used. It is possible the server could quit responding, report errors, or even refuse connections if it believes you are misusing it. This is particularly important when accessing a public site that is not under your control. Most web browsers will do as many as 6 simultaneous transfers, but these would typically be relatively small transfers as a part of a web page. For a server inside your own business where you have more control over how it is configured, using a higher number of connections may be okay.

    Additionally, because the Download tool will send records downstream as transfers complete, it will likely result in a change in the order of records as they pass through the tool. If the order matters to your workflow, make sure to sort the results or limit the number of connections to 1. Finally, please note that empty URLs will be processed ahead of those that require an actual transfer.

  5. Timeout (seconds): Specify the number of seconds to wait before reporting a timeout due to an unresponsive connection. Select a number from 0 (never timeout) to 10,000.

Other Considerations

To avoid connection delays when using the Download tool, ensure that the “Automatically detect settings” option is deselected within your account’s internet properties (Control Panel > Internet Options > Connections > LAN Settings).