Skip to main content

Native URL to Attachment


Forum|alt.badge.img+12

Hi everyone,

I just wanted to share a quick tip I use.
I often see people use Zapier or miniExtensions to do this basic operation so it may be easier to do this way.

I am using the Automation feature of Airtable to trigger when the record has a “pending URL” (that should be processed).

When triggered, Airtable let’s you set the Attachment field type with an “URL” value and will automatically convert it. (tested for images and PDFs)

Demo base available here

Florian

28 replies

ScottWorld
Forum|alt.badge.img+33
  • Brainy
  • 8801 replies
  • October 23, 2020

Thanks for the excellent reminder on this! A great way to quickly add attachments to a base! 😊

This is very similar to the technique that people would use when integrating Make’s Airtable automations & integrations, but you wouldn’t need to use a temporary field to store the URL… you would just send the URL directly to the attachment field. (Make offers significantly more advanced automations & integrations that the native built-in functionality of Airtable.)

A common use-case for all of this is when people want to automatically import & export CSV files with Airtable, and their CSV files have links to images in them. All of this can be setup to happen automatically with Make’s CSV tools, and I discuss importing & exporting CSV files with Make on this episode of the BuiltOnAir podcast.

Also, for a deep dive into working with attachments in Airtable using Make, check out my demonstration on this Airtable podcast episode.

And remember the most important thing when working with URLs for attachments: Whether you’re using Airtable’s automations or Make’s automations to do this, the image must be at a publicly-accessible URL.

There is a small learning curve with Make, which is why I created this basic navigation video to help. I also provide the links to a few other Make training resources there as well. For example, to instantly trigger your Make scenarios from Airtable, check out this thread.

Hope this helps! If you’d like to hire an expert Airtable consultant to help you with anything Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld 

p.s. I think that I just stumbled upon a strange Airtable bug when sharing a base that has automations in it. You shared a link to your whole base, and then I clicked on your link, and then I clicked on “COPY BASE” to copy your base into my own workspace. After I did that, there were no automations in my copy of the base. I wonder if other people are experiencing this same bug? Hopefully, Airtable will fix this bug soon.


I also faced the same.
I replicated the automation , but the images are not downloading , just a file name… could not figure out what is the problem. The images are stored in a google drive and the attachments are in the Airtable base with a Attachment field empty. Is it something to do with permissions ?


Forum|alt.badge.img+12

Hi @Hari_Balasubramanian

Please note that Airtable must be able to « see » this attachment.
Airtable is not connected to your Google account so is considered as « public » when getting the file from URL.
You have to make sure that the file / folder in GDrive is shared as public.

If you can’t make it work, just send me an example URL and I will try to figure it out.

Please note that I built an Airtable <-> Google Drive integration. Do not hesitate to send me a private message if you are interested and wants more information on this.

Florian


Florian_Verdon2 wrote:

Hi @Hari_Balasubramanian

Please note that Airtable must be able to « see » this attachment.
Airtable is not connected to your Google account so is considered as « public » when getting the file from URL.
You have to make sure that the file / folder in GDrive is shared as public.

If you can’t make it work, just send me an example URL and I will try to figure it out.

Please note that I built an Airtable <-> Google Drive integration. Do not hesitate to send me a private message if you are interested and wants more information on this.

Florian


Thank you so much. The URL links were HTML files . That is why they were not working. It is working with links of images.


Forum|alt.badge.img+12
  • Known Participant
  • 27 replies
  • November 3, 2020
ScottWorld wrote:

Thanks for the excellent reminder on this! A great way to quickly add attachments to a base! 😊

This is very similar to the technique that people would use when integrating Make’s Airtable automations & integrations, but you wouldn’t need to use a temporary field to store the URL… you would just send the URL directly to the attachment field. (Make offers significantly more advanced automations & integrations that the native built-in functionality of Airtable.)

A common use-case for all of this is when people want to automatically import & export CSV files with Airtable, and their CSV files have links to images in them. All of this can be setup to happen automatically with Make’s CSV tools, and I discuss importing & exporting CSV files with Make on this episode of the BuiltOnAir podcast.

Also, for a deep dive into working with attachments in Airtable using Make, check out my demonstration on this Airtable podcast episode.

And remember the most important thing when working with URLs for attachments: Whether you’re using Airtable’s automations or Make’s automations to do this, the image must be at a publicly-accessible URL.

There is a small learning curve with Make, which is why I created this basic navigation video to help. I also provide the links to a few other Make training resources there as well. For example, to instantly trigger your Make scenarios from Airtable, check out this thread.

Hope this helps! If you’d like to hire an expert Airtable consultant to help you with anything Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld 

p.s. I think that I just stumbled upon a strange Airtable bug when sharing a base that has automations in it. You shared a link to your whole base, and then I clicked on your link, and then I clicked on “COPY BASE” to copy your base into my own workspace. After I did that, there were no automations in my copy of the base. I wonder if other people are experiencing this same bug? Hopefully, Airtable will fix this bug soon.


I have the same issue, when importing this base the automations are missing. I had the same issue a few days ago when I attempted to share my own base with automations in it, the scripts weren’t carried over.


Forum|alt.badge.img+12
Tim_Mackey wrote:

I have the same issue, when importing this base the automations are missing. I had the same issue a few days ago when I attempted to share my own base with automations in it, the scripts weren’t carried over.


Hi @Tim_Mackey

Actually, this does not require scripting.
It works using only Automations with Update Record action as shown on the screenshot.


Forum|alt.badge.img+12
  • Known Participant
  • 27 replies
  • November 3, 2020
Florian_Verdon2 wrote:

Hi @Tim_Mackey

Actually, this does not require scripting.
It works using only Automations with Update Record action as shown on the screenshot.


Oh perfect, that’s really simple! Thanks!


Forum|alt.badge.img+4
  • New Participant
  • 2 replies
  • December 11, 2020

Works great! Tho there’s a minor issue: Label gets lost.
It just uses the filename as label, in which means any custom label and spaces will be removed.
It’s surprising Airtable doesn’t already convert LABEL (URL) to attachments, even when it was originally an attachment converted to text. :thinking:
But oh, well. What can you do? I hope someday I can re-format the labels in batch using a backup of the original label I made in a separate field.


Bastien_Vairet
Forum|alt.badge.img+1

Hi Florian, I did not succeed to make it using this tutorial.
I have a database with url to images host on a third website and I just need to turn it into attachement into Airtable. I do not understand what I am doing wrong. Would you accept to help me ?


Forum|alt.badge.img+12
Bastien_Vairet wrote:

Hi Florian, I did not succeed to make it using this tutorial.
I have a database with url to images host on a third website and I just need to turn it into attachement into Airtable. I do not understand what I am doing wrong. Would you accept to help me ?


Hello @Bastien_Vairet,

As explained in my email (just for history purposes and may help others in the future), you chose the wrong trigger.

When doing this, please make sure you use a trigger that is appropriate. The easiest one is “Record is updated” → on a specific field “URL” (url of the file to upload).

You may also chose to trigger on “view entry” (record enters a view) but you have to make sure the view is configured properly.

Florian


Forum|alt.badge.img+7
Florian_Verdon2 wrote:

Hello @Bastien_Vairet,

As explained in my email (just for history purposes and may help others in the future), you chose the wrong trigger.

When doing this, please make sure you use a trigger that is appropriate. The easiest one is “Record is updated” → on a specific field “URL” (url of the file to upload).

You may also chose to trigger on “view entry” (record enters a view) but you have to make sure the view is configured properly.

Florian


Hi Florian. Does this still work?
I’ve used the update record trigger and action steps, and shared the Google Drive file and image. I’m using .png image files. This is the Trigger field with corresponding URLs and Attachment field output:

For some reason the images show up as files. My goal is to pull these images directly from this field into a web app interface that directly integrates with Airtable, so the file type, quality, and size are important.


Forum|alt.badge.img+12
Benjamin_Watrou wrote:

Hi Florian. Does this still work?
I’ve used the update record trigger and action steps, and shared the Google Drive file and image. I’m using .png image files. This is the Trigger field with corresponding URLs and Attachment field output:

For some reason the images show up as files. My goal is to pull these images directly from this field into a web app interface that directly integrates with Airtable, so the file type, quality, and size are important.


Hello @Benjamin_Watrous,

Yes it’s still working on my side.

Could you please share an example URL you are using ?

Please note there are (at least) two types of Google Drive URLs :

  • Preview link (with the nice “previewer”)
  • File download link (when clicked → triggers a download automatically)

(Please check the following page for more information about all URL variations available on Google Apps)

You can only use the second one because the first one will be downloaded by Airtable as “text” (download the previewer page and not the file itself)

Florian


Forum|alt.badge.img+7

Forum|alt.badge.img+7
Benjamin_Watrou wrote:

That last post was me just pasting the link.


Forum|alt.badge.img+12
Benjamin_Watrou wrote:

That last post was me just pasting the link.


As explained above, you link is a “preview link”.
Please take the time to read my answer and visit the link I gave you.


Forum|alt.badge.img+7

Took “the time” (all afternoon) to read your answer, the link you provided, and changed the links, however this is my output still:

These URLs, from the article, work in a browser, but not in my update record automation.


Forum|alt.badge.img+12
Benjamin_Watrou wrote:

Took “the time” (all afternoon) to read your answer, the link you provided, and changed the links, however this is my output still:

These URLs, from the article, work in a browser, but not in my update record automation.


Hello @Benjamin_Watrous,

Please note the presence of a “?” between the /uc and export in the URL
Your generated link is missing that “?” symbol.

https://drive.google.com/uc?export=download&id=DRIVE_FILE_ID

What I usually do when working with Google Files (Docs, Sheet or “files” in Drive) is just store the “ID” of the document in Airtable. (column named “GDrive File ID”).

Then I create a formula column that calculates the final URL to “view” or to “download”.

That formula for a download would look like :
"https://drive.google.com/uc?export=download&id=" & {GDrive File ID}

Using that “calculated” URL would be perfectly fine to use in an automation

Let me know if it worked for you :thumbs_up:

Florian


Forum|alt.badge.img+7
Florian_Verdon2 wrote:

Hello @Benjamin_Watrous,

Please note the presence of a “?” between the /uc and export in the URL
Your generated link is missing that “?” symbol.

https://drive.google.com/uc?export=download&id=DRIVE_FILE_ID

What I usually do when working with Google Files (Docs, Sheet or “files” in Drive) is just store the “ID” of the document in Airtable. (column named “GDrive File ID”).

Then I create a formula column that calculates the final URL to “view” or to “download”.

That formula for a download would look like :
"https://drive.google.com/uc?export=download&id=" & {GDrive File ID}

Using that “calculated” URL would be perfectly fine to use in an automation

Let me know if it worked for you :thumbs_up:

Florian


Thanks for the organization tip!

Yes. I noticed the missing question mark and had already replaced it, with no luck. Airtable support provided working URL though. It’s slightly different than yours in that it leaves out “download&id” part:

https://drive.google.com/uc?id=FILE_ID_HERE

Appreciate the replies. Your info was the closest I came until Airtable support helped out.

Kind regards,

Ben


Forum|alt.badge.img+7

Sorry. Correction. Working URL replaces “export=download&id=” with “id=FILE_ID_HERE”.


Forum|alt.badge.img+7
Benjamin_Watrou wrote:

Sorry. Correction. Working URL replaces “export=download&id=” with “id=FILE_ID_HERE”.


Looks like a simple setting change downloaded the images. Since it was an attachment field, once I increased the row height from the smallest size (default), the images populated :laughing: .
Thanks for following up Florian! I’ll keep you in mind moving forward.


Forum|alt.badge.img+7
Benjamin_Watrou wrote:

Looks like a simple setting change downloaded the images. Since it was an attachment field, once I increased the row height from the smallest size (default), the images populated :laughing: .
Thanks for following up Florian! I’ll keep you in mind moving forward.


Airtable support confirmed issues with GDrive files: “I did some more digging internally and there is an existing issue with uploading Google Drive URLs to an attachment field that can cause intermittent failures. That might have been what you encountered here (since the row height should not affect this behavior at all)”


  • New Participant
  • 2 replies
  • September 4, 2021

Hi Florian,
First of all I’m completely new to airtable. I’ve a table with 10k public image urls, which I like to convert to attachments, so I can deploy the vision app on these images.

I opened your Demo link and replicated the base. However, can’t see the pending URL’s table anywhere.

Although I’ve already upgraded my plan airtable is still keeping me in the trial mode. Maybe that’s why I can’t see the the table? Also, if I create a trigger the “run a script” optin is simply greyed out.

Would love to hear what I can do differently.
Thanks,
Max


Forum|alt.badge.img+12
Max_Berger wrote:

Hi Florian,
First of all I’m completely new to airtable. I’ve a table with 10k public image urls, which I like to convert to attachments, so I can deploy the vision app on these images.

I opened your Demo link and replicated the base. However, can’t see the pending URL’s table anywhere.

Although I’ve already upgraded my plan airtable is still keeping me in the trial mode. Maybe that’s why I can’t see the the table? Also, if I create a trigger the “run a script” optin is simply greyed out.

Would love to hear what I can do differently.
Thanks,
Max


Hello @Max_Berger,

You don’t really need the Pending URLs table, any table can handle this, you just have to configure the automation to run on your table.

About the “Run script” option disabled, I would recommend to try logging out and logging in again, just to see if it solves the problem.

Did you take the “PRO” plan ? (not PLUS, PLUS is just a limit increase compared to FREE)

Florian


  • New Participant
  • 2 replies
  • September 4, 2021

Hi @Florian_Verdonck thanks for your fast reply. I logged out and logged in again. Somehow I’m stuck in the trial. It says the pro version will start after the trial pro has ended. But I couldn’t find a way to cancel the trial and start with the real pro versio right away.

I guess I’ve to contact Airtable and ask them to charge me right away… Haha I’ll never had to bag a company to charge me.

Hopefully, it’s gong to work then. As far as I understand copying your base would also copy the necessary script or?
Thanks!
Max


  • New Participant
  • 4 replies
  • January 7, 2022
Florian_Verdon2 wrote:

Hello @Benjamin_Watrous,

Please note the presence of a “?” between the /uc and export in the URL
Your generated link is missing that “?” symbol.

https://drive.google.com/uc?export=download&id=DRIVE_FILE_ID

What I usually do when working with Google Files (Docs, Sheet or “files” in Drive) is just store the “ID” of the document in Airtable. (column named “GDrive File ID”).

Then I create a formula column that calculates the final URL to “view” or to “download”.

That formula for a download would look like :
"https://drive.google.com/uc?export=download&id=" & {GDrive File ID}

Using that “calculated” URL would be perfectly fine to use in an automation

Let me know if it worked for you :thumbs_up:

Florian


Adding my two cents to this, there seems to be a slight lag between the permissions change in GDrive and its propagation. This means that Airtable might not immediately import them.


Reply