Select Page
How to View Attachment Fields and IDs from On2Air Backups in Your Storage Drive (includes Script)

How to View Attachment Fields and IDs from On2Air Backups in Your Storage Drive (includes Script)

In this video, you’ll learn how to view Airtable attachment fields, field names, and field IDs from On2Air Backups in your Google Drive, Dropbox, or Box storage drive. This will help you easily identify which Attachments are related to which Airtable fields. You’ll copy a scripting code we provide and add it to the Scripting extension in your Airtable base.

In this tutorial

What is On2Air Backups?

On2Air Backups creates automated backups of your Airtable data and sends the data to your storage drive in Google Drive, Dropbox, and Box.

🎥 Tutorial Video

Airtable Script to View Attachment Fields and IDs

Follow the link below and Copy the script. You’ll then paste it into the Scripting extension in your Airtable base.

 * On2Air Backup Scripts
 * Owned by
 * All rights reserved.
 * Copywrite 2023

output.markdown("# On2Air Backups Scripts")
output.markdown('##### Scripts assocated with On2Air: Backups. All rights reserved.')
const table = await input.tableAsync("Select Table containing attachments")
const attFields = table.fields.filter( f => f.type === 'multipleAttachments')
output.markdown("# Select an Action")
const options = ['Display Field IDs', 'Search by Record', 'Search by Att']
const selection = await input.buttonsAsync('Select', options)
const index = options.indexOf(selection)
    case 1:{//by record
        output.markdown("## Search by Record Name")
        const recMatch = (await input.textAsync("Enter Search")).toLowerCase()
        const records = (await table.selectRecordsAsync({fields:attFields})).records
        output.table( records.filter( r => r => {
            const out = {,}
            for(let af of attFields){
                out[] = (r.getCellValue(af) || []).map( a => + "\t|\t" + a.filename).join("\n")
            return out
        }) )
    case 0:{//att field
        output.markdown('## Attachment Fields in Table: ' +
        output.table( af => ({, id:})))
    case 2:{//search by att id
        output.markdown("## Attachment Search")
        const recMatch = (await input.textAsync("Enter Search by Att Value")).toLowerCase()
        const records = (await table.selectRecordsAsync({fields:attFields})).records
        const matches = []
        records.forEach( r => {
            for(let af of attFields){
                const items = (r.getCellValue(af) || [])
                for(let item of items){
                    if( || item.filename.toLowerCase().includes(recMatch)){
                        matches.push({record_id:, name:, field_id:, field:, att_id:, att_name: item.filename})
        output.markdown("## Matching Attachments")
        output.table( matches )