Help

Pull URL from Image Attachment or use MID+FIND to format?

4815 6
cancel
Showing results for 
Search instead for 
Did you mean: 
Fred_Barnes
4 - Data Explorer
4 - Data Explorer

So I have thousands of images stored as attachments within a base. Each record in the base has 1 image attached to the “Image” column I have created. When I export my base to a CSV file, instead of giving the URL it gives the internal image name followed by the url IN ( ). I can’t type out a url in here so I have attached a screenshot of what it is doing

I can’t type out a url in here so I have attached a screenshot of what it is doing

I need the raw CSV file exported to have a properly formatted URL:

I can’t type out a url in here so I have attached a screenshot of what it is doing

As a workaround, I am trying to create a new formula field next to the image column that uses a formula to delete the beginning and end of the improperly formatted URL. If I create a formula field and simply set it to = {Image} I can get that field to display the improper URL:

Is there a way to expand upon that formula similar to a excel where I could maybe use a MID & FIND combo to format the result as desired?

Or as an even simpler solution, is there a way to pull the exact url and have it save properly in a field without the garbage?

Any help would be appreciated. I have been struggling with this for days… Capture.JPG

6 Replies 6

I think something like this should work:

RIGHT(
   LEFT(
      Image,
      LEN(Image) - 1
   ),
   LEN(
      LEFT(
         Image,
         LEN(Image) - 1
      )
   ) - SEARCH(
      "https://",
      Image
   ) + 1
)

But this will only work if there is only a single image attached in the {Image} field for each record. If there is more than 1 image in that field for any record, you will have to do more processing on the string across multiple fields to isolate each URL.

This is amazing! @Fred_Barnes and @Jeremy_Oglesby, I’m so curious for your thoughts on a few questions.

  1. How did you get the function imageScr to display the file name and link?
  2. How do I import a database of a list people that have text-based-data-fields and 1-2 photos/attachments per person? I have the (a) excel file with all the data including the file name of the photo/attachments in each ‘person’ line item, and (b) all the files/attachments/photos that match the ‘file name’ in the main table list. Each record is a person/contact and each photo/attachment/file is a business card image that I’m looking to see in large size in AirTable. And the back of a business card for some of the contacts/people. There will be an initial import (of people and business cards), and then add more over time. So solution should be able to easily handle that. :slightly_smiling_face:
  3. How to export data that includes: (a) the data, (b) the attachments in high-resolution, (c ) the file name for the attachments in each line item (so I can import it back somewhere and ensure automatically matches up with the record/contact it belongs with)
Hannah_Henry
5 - Automation Enthusiast
5 - Automation Enthusiast

@Brenda_Ginsberg I would recommend using MiniExtensions for bulk download and assign the field name you want associated to each attachment. Then you can match them up.
I’ve been really happy with their add ons to AT esp since my scripting block is disabled. I do wish Airtable had better image management like ecommerce databases.

Miquel_Capo_Cas
6 - Interface Innovator
6 - Interface Innovator

I’ve created a script to achieve this for multiple images too. You can get the name or url and then play with offsets to adjust the data to output.

I’ve created a script to achieve this for multiple images too.

There’s also an issue when the file name contains a comma for example. Airtable will put double quotes around the complete result, throwing off the ‘- 1’ correction.

Another approach here: Extracting single image/attachment URL