Help

Extract most recent attachment URL from list of attachments

Topic Labels: Formulas
Solved
Jump to Solution
797 2
cancel
Showing results for 
Search instead for 
Did you mean: 
seanwhitcomb
4 - Data Explorer
4 - Data Explorer

I have a formula field that returns the URLs of an attachment field. If there's only one attachment, it returns one URL in parentheses. But multiple attachments take this form: "File Name 1 (URL 1), File Name 2 (URL 2)".

Here is an example: "Screenshot 2023-07-03 141051.png (https://dl.airtable.com/.attachments/c53420d1c5692651db4f6c34e5ddc19f/8256aa0b/Screenshot2023-07-031...), Screenshot 2023-06-23 130019.png (https://dl.airtable.com/.attachments/1d08cfcdd7ce28fa575f0c20738ae2ea/bc5c5421/Screenshot2023-06-231...)".

I want to write a formula that will extract only the URL in the last set of parentheses, no matter how many other files are listed in the cell (or just the single URL if there's only one file). In other words, I want to extract the URL of the most recently uploaded attachment, which is always the last one listed in the cell.

1 Solution

Accepted Solutions
ScottWorld
18 - Pluto
18 - Pluto

Formulas no longer return valid URLs, so you won’t be able to use formulas to view attachments.

See Solution in Thread

2 Replies 2
ScottWorld
18 - Pluto
18 - Pluto

Formulas no longer return valid URLs, so you won’t be able to use formulas to view attachments.

Sho
11 - Venus
11 - Venus

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.