Help

Export grid to Excel with images

Topic Labels: Base design
13343 23
cancel
Showing results for 
Search instead for 
Did you mean: 
matt_stewart1
7 - App Architect
7 - App Architect

Looking for a way to export grid data WITH attachments.

Perfect world solution would be to download as excel and keep attachments. This would be the most preferred solution if there was a script or extension/app/block allowing to export a view to google sheets or to excel, so that it is still a spreadsheet data but with attachments loaded into the corresponding cells.

I did manage to use a google sheets formula to convert url’s into images with ‘=image()’ … that being said once I tried downloading to excel it again does not show the images. So maybe as a backup solution is anyone aware of a formula in excel that can be quickly applied to convert a batch of urls into images in adjacent cells?

23 Replies 23

With Excel you can grab data from the internet. I has been a while since I have done it but you can:

  1. Open Excel to a new workbook
  2. Navigate to Data and choose from Web
  3. Open your Airtable accounts page and go to the API documentation and get a URL. Something like
https://api.airtable.com/v0/appXXXXXX/Table%202?api_key=keyXXXXXX&maxRecords=50&view=Grid%20view
  1. Paste the URL into the Excel popup
  2. Now you can add the query to your book
  3. This will give you URL for the image
  4. Add some VBA like this for excel to get that image file:
Sub InstallPictures()
    Dim i As Long, v As String
    For i = 2 To 1903
        v = Cells(i, "B").Value
        If v = "" Then Exit Sub
        With ActiveSheet.Pictures
            .Insert (v)
        End With
    Next i
End Sub

Or you can download the CSV, this will give you the file name and the URL. You will need to separate them and then use the VBA above to grab the image file.

There is also an excel plugin (non free but has a trial) from CDATA i have not used it.

And on November 1st 2022, all those URLs will not work any longer. :expressionless:

If you build systems that have dependencies on Airtable attachment URLs, you have three avenues going forward:

  1. Build your own CDN and include in the extraction process a re-instantiation of the attachment documents in that CDN;
  2. Include in the extraction process a re-instantiation of the attachment documents in a different repository that will sustain access for your external solution;
  3. Of course, Excel is capable of storing documents inside cells, but this will require some clever VBScript. Importing attachment URLs as a CSV will not help - you need to muscle through this with script.

It looks like he is getting data using the REST API. So he should get an expiring url that will work for the time it takes to get the image.

However, the api call doesn’t quite right to me. It doesn’t specify which record, will only get 50 records, and doesn’t specify which field. This usage of the API key could also be risky, depending on where in the workbook it is stored, who else has access to the workbooks, and if the file is ever shared with anyone else in the future.

@matt_stewart1

This is so incredibly easy to do with Make.com, and it doesn’t require any knowledge of coding or scripting at all.

It even uses the =IMAGE(“URL HERE”) formula that you already know so well from Excel and Google Sheets.

This process is the exact same for both Microsoft Excel 365 and Google Sheets, but here are example screenshots of how easy it is to search for records in Airtable and then send all of those records to Google Sheets with images intact:

image

image

p.s. If you’d like to hire an expert Airtable consultant to help you set this up, feel free to reach out to me through my Airtable consulting website.

Indeed, you have to finish the play by getting and sustaining the attachment. Nowhere in that process is the URL transformed from a reference into a value (i.e., the image or document itself).

And how [exactly] will that work with a signed URL that has expired after a few hours?

Um… because it only takes a millisecond to process, not a few hours?

And what is your definition of “process”?

An Image() formula in Google and Excel is a live formula - always refreshing. It is not designed like Airtable’s attachment system that reads the image, makes a copy, and hosts it in a new CDN location.

image

Oh, well dammit! :man_facepalming: :crazy_face:

I didn’t know that, but that makes 100% perfect sense… and thank you for pointing that out, @Bill.French!

If that’s the case, then my immediate solution above won’t work.

Then @matt_stewart1 could only successfully use my solution by permanently storing his Airtable images in a cloud drive somewhere that results in a permanent & always-accessible URL.

He could do this by adding another step in the middle:

image

image

image