Jul 22, 2022 09:50 AM
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?
Jul 22, 2022 02:10 PM
With Excel you can grab data from the internet. I has been a while since I have done it but you can:
https://api.airtable.com/v0/appXXXXXX/Table%202?api_key=keyXXXXXX&maxRecords=50&view=Grid%20view
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.
Jul 23, 2022 02:39 PM
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:
Jul 23, 2022 02:58 PM
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.
Jul 23, 2022 03:26 PM
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:
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.
Jul 23, 2022 03:37 PM
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).
Jul 23, 2022 03:38 PM
And how [exactly] will that work with a signed URL that has expired after a few hours?
Jul 23, 2022 03:40 PM
Um… because it only takes a millisecond to process, not a few hours?
Jul 23, 2022 03:43 PM
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.
Jul 23, 2022 03:56 PM
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: