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


#1

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…


#2

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.