Help

Image URL Formula?

Topic Labels: Formulas
Solved
Jump to Solution
4186 9
cancel
Showing results for 
Search instead for 
Did you mean: 
Michael_Baugher
4 - Data Explorer
4 - Data Explorer

I’m hoping someone might be able to help me figure this out… To put it simply I have one column full of images (just one image in each cell) but 1000’s of images total. I need another column, residing next to it that contains the URL for each image, and I haven’t found an easy way to do this aside from just copy and pasting each individual URL. Which gets very repetitive and time consuming doing this thousands of times. Is there a formula out there that could pull these image URL’s and fill each corresponding cell (to the right of the image cell) with the URL (of the image in the cell to the left of it)? Maybe I’ve just been looking at it for too long and there’s a much simpler solution?

1 Solution

Accepted Solutions
Jason
Airtable Employee
Airtable Employee

Hi @Michael_Baugher ,

You can use a formula like this:

SUBSTITUTE(
  MID(
    {Attachment Field},
    FIND(
      "https://dl",
      {Attachment Field}
    ),
    250
  ),
  ")",
  ""
)

Just make sure to replace {Attachment Field} with the actual name of the field you’re using to store them.

See Solution in Thread

9 Replies 9
Jason
Airtable Employee
Airtable Employee

Hi @Michael_Baugher ,

You can use a formula like this:

SUBSTITUTE(
  MID(
    {Attachment Field},
    FIND(
      "https://dl",
      {Attachment Field}
    ),
    250
  ),
  ")",
  ""
)

Just make sure to replace {Attachment Field} with the actual name of the field you’re using to store them.

Michael_Baugher
4 - Data Explorer
4 - Data Explorer

Worked like a charm! Thanks so much, saved me hours of copy/pasting!

Happy to help Michael!

ScottWorld
18 - Pluto
18 - Pluto

This is an old thread, so please note that these formulas will no longer work in 2023 and beyond, because Airtable will no longer return working attachment URLs using formulas.

Also, any URLs that are retrieved via automations will expire after 2 hours. So if you want access to an image or an attachment for more than 2 hours, you will need to move the image somewhere else.

If you need this process to be automated, you can use Make to automate the process of moving the attachments out of Airtable and into a publicly-accessible cloud drive (such as Google Drive).

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.

p.s. If you have a budget for your project and you’d like to hire an expert Airtable consultant to help you with any of this, please feel free to contact me through my website: Airtable consulting — ScottWorld

fkoimburi
4 - Data Explorer
4 - Data Explorer

Hey Scott. Do you known if already expired links are accessible after the fact? I am using Bubble to access images within my Airtable DB and I was unaware about the expiration of the links until users had began accessing hundreds of images on the live web app of our family photography business. So essentially users have already made their orders and selected their images, and we are seated with image-less orders that require some sort of "recovery".

Thanks in advance.

Yes, if you create a formula field that points to your attachment field, you will see the old URL. It won’t work anymore, but you’ll be able to see what it was.

fkoimburi
4 - Data Explorer
4 - Data Explorer

Thanks Scott.

I may not have explained myself very well. On the web development platform that I am using, the images users see reside in Airtable and they are being pulled via an API. The images themselves are accessible to me on the Airtable backend, but it is in my web based platform (Bubble) where the dead URL lies. I have no idea of knowing what images the users selected. When I do as you have suggested, all it does is give me the URL of the already-existing image on the Airtable side. 

What am I missing? Again, apologies if I am not making myself very clear -- this particular functionality of Airtable is new to me.

Sorry, I have never used Bubble before so I have no idea how it works.

In general, apps that have full native support for Airtable will already take care of this issue for you. I’m thinking of apps like Noloco, Softr, JetAdmin, or Glide.

The app needs to always pull the latest URL which expires after 2 hours.  This is done through the Airtable API. All the apps that I mentioned do this automatically. I would talk to the Bubble people about this.

 

 

 

 

Thanks Scott. I'll keep searching.