Hi @Jovan,
Airtable is not really designed to serve files outside of the platform, so I imagine you are going to run into issues when trying to send files from airtable via QR code link.
I would suggest using some sort of cloud storage CDN for serving up your PDFs like AWS S3 Bucket for example.
However - there is a workaround that seems to work with airtable currently (not sure how long this might work for because it’s a bit of a security hole.) There is a hidden URL you can access on your attachments via a script or the Airtable API. You can add a scripting app and use my little script below to print out the URLs for your PDFS and then use these URLS for your QR codes. Just change the name of your table and the name of your attachments field to whatever is in your table.
let nameOfTable = "Name of Table"
let nameOfAttachmentField = "Name of Attachments Field"
let table = base.getTable(nameOfTable)
let recordQuery = await table.selectRecordsAsync()
for (let record of recordQuery.records) {
let attachmentField = await record.getCellValue(nameOfAttachmentField)
if (attachmentField) {
for (let attachment of attachmentField) {
output.markdown(`**${record.name} - ${attachment.filename}:**
${attachment.url}
`)
}
}
}
Hi @Jovan,
Airtable is not really designed to serve files outside of the platform, so I imagine you are going to run into issues when trying to send files from airtable via QR code link.
I would suggest using some sort of cloud storage CDN for serving up your PDFs like AWS S3 Bucket for example.
However - there is a workaround that seems to work with airtable currently (not sure how long this might work for because it’s a bit of a security hole.) There is a hidden URL you can access on your attachments via a script or the Airtable API. You can add a scripting app and use my little script below to print out the URLs for your PDFS and then use these URLS for your QR codes. Just change the name of your table and the name of your attachments field to whatever is in your table.
let nameOfTable = "Name of Table"
let nameOfAttachmentField = "Name of Attachments Field"
let table = base.getTable(nameOfTable)
let recordQuery = await table.selectRecordsAsync()
for (let record of recordQuery.records) {
let attachmentField = await record.getCellValue(nameOfAttachmentField)
if (attachmentField) {
for (let attachment of attachmentField) {
output.markdown(`**${record.name} - ${attachment.filename}:**
${attachment.url}
`)
}
}
}
Hi Jono_Prest,
I figured that much after scouring the “Airtable Universe”.
Thank you for the code, I’m reluctant to use this workaround as it will be the “backbone” of the project.
If Airtable decides to close the theoretical security loophole - the project will be in shambles…
Once again, thank you for your assistance, I’ll be exploring how I can utilize either AWS or CDN.
Cheers!