Unfortunately, formulas no longer return valid URLs, so you won’t be able to use formulas to grab valid URLs for attachment fields.
However, you can use automations to grab URLs of the attachments. Note that those URLs are now “expiring URLs”, and they will expire 2 hours after a non-Airtable user accesses that URL for the first time.
You can either use Airtable’s native automations to grab those expiring URLs, or you can use Make’s advanced Airtable automations to do the same thing.
Also, if you need the URLs to last longer than 2 hours, then you will want to store your attachments on a cloud storage space like Google Drive. You can automatically do that with Make as well. I describe that process in this thread: Archiving Attachments in Google Drive.
Hope this helps!
If you’d like to hire the best Airtable consultant to help you with anything Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld
This is possible by using automation to return a list of viewer URLs for attachments.
Create a Single Line Text field to receive the URL list string, and use automation to update the URL when the attachment is updated.
In the Open URL expression of the Formula field or button,
REGEX_EXTRACT({URL},".*, (.*)$")
Only the last URL is extracted.
Use this script to extract multiple attachment URLs.
In this case Invoices is where the attachments are and Invoice URLs is a long text field to capture the URLs.
// Get input variables from the automation
let inputConfig = input.config();
let recordId = inputConfig.recordId;
// Load the record from the Orders table
let table = base.getTable("Orders");
let record = await table.selectRecordAsync(recordId);
let attachments = record.getCellValue("Invoices") || o];
let urls = attachments
.map(file => file.url)
.join("\n");
// Update the record with the extracted URLs
await table.updateRecordAsync(recordId, {
"Invoice URLs": urls
});
Just make sure to create an input variable called recordId with the Record ID.