Help

Re: Native URL to Attachment

9035 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Florian_Verdon2
7 - App Architect
7 - App Architect

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)

URL_To_Attachment

Demo base available here

Florian

28 Replies 28
ScottWorld
18 - Pluto
18 - Pluto

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

This is the exact same technique that people would use when integrating Make’s Airtable automations & integrations, which offers significantly more advanced automations & integrations that the native built-in functionality of Airtable.

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.

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.

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

p.s. If anybody reading this thread needs extra help with this, and you have a budget to hire an expert Airtable consultant, please feel free to contact me through my website: Airtable consulting — ScottWorld 

p.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.

Hari_Balasubram
6 - Interface Innovator
6 - Interface Innovator

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 ?

Florian_Verdon2
7 - App Architect
7 - App Architect

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.

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.

Oh perfect, that’s really simple! Thanks!

3DJ
5 - Automation Enthusiast
5 - Automation Enthusiast

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
5 - Automation Enthusiast
5 - Automation Enthusiast

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

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:

image

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

Benjamin_Watrou
6 - Interface Innovator
6 - Interface Innovator

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.

Benjamin_Watrou
6 - Interface Innovator
6 - Interface Innovator

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

image

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

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

Benjamin_Watrou
6 - Interface Innovator
6 - Interface Innovator

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