Help

Re: Is this even possible...?

Solved
Jump to Solution
424 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Jovan
4 - Data Explorer
4 - Data Explorer

Hi everyone!

As a preface, I’m not a coder and this is new waters for me - but willing and capable to learn!
What I’m trying to accomplish:

I want to use Airtable as a database to store all my products which will each have their own unique PDF {which I’ll upload to Airtable} and then link said PDF to a QR Code. I’ll print these QR Codes and the expectation is that should a 3rd party {not a contributor} scan the code it links to the PDF in the database.

So, I set up the QR app and generate a code pointing to the PDF, when scanned I either get directed to the Appstore to download Airtable, or once I pointed it differently it returned a “[Object object]” string value.

In short - I’m against a wall and can’t seem to figure it out! Do I need a unique script or setup from Zapier? Or am I missing something?

1 Solution

Accepted Solutions
Jono_Prest
6 - Interface Innovator
6 - Interface Innovator

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}

            `)
        }
    }
}

See Solution in Thread

2 Replies 2
Jono_Prest
6 - Interface Innovator
6 - Interface Innovator

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!