URL download CSV file

I have a URL that when run from browser auto downloads the file (.csv) to my machine. In retool, i would like to run that url and put results (.csv) into a table for viewing.

https://example.com/api/v2/downloads/658b02922663499f

Hello @claycurtis44,

Retool's browser environment doesn't directly allow you to intercept and process a downloaded CSV file from a URL in the way you might expect. Instead, you need to fetch the file's content as text and then parse it.

1. Using a REST API Resource:

  • Create a REST API Resource:
    • In your Retool app, go to "Resources" and create a new "REST API" resource.
    • Set the "Base URL" to the base URL of your file download URL (if applicable)

2. Set Up a Query:

  • Create a new query using the resource you just created.
  • Method: Choose GET.
  • In the URL field, input your CSV URL.

3.Parse the CSV:

  • To convert the CSV response to JSON format for the table, you can use a JavaScript transformer.

4.Displaying the Data in a Table

3 Likes