Skip to content
aeropage-round-dark
Aeropage Documentation
Dynamic Tools and APIs

icon picker
Downloading to Attachments

Once you have your urls working, you may want to download the file from the URL into an attachment field in Airtable using an Automation.

no-entry
This is not a solution to bulk generate files, this should be run for one record at a time.


Create the Automation

You will likely find that trying to download a file the first time its generated will take too long - and the download will fail. So make sure to add both steps below to your automations.

Untitled.png

Step 1 : Start the Rendering

Run a script before trying to download the file - to make sure the automation waits until it’s rendered.

Untitled 1.png

You will need to create an input variable called url with the value from your formula field with the url.
let {url} = input.config();
let apiResponse = await fetch(url);
let data = await apiResponse.text();

Step 2 : Download the File

Once rendered, Airtable will be able to download it from the same url.

Untitled 2.png

Test the Automation

Now when checkbox is checked, it runs the automation and downloads the file. The url is tied to the modified time on the record, so if the record changes - clicking and then clicking again will cause it to rerender with the new data.

2024-02-14_17.33.56.gif
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.