Jul 20, 2023 09:17 AM
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.
Solved! Go to Solution.
Jul 20, 2023 09:52 AM
Formulas no longer return valid URLs, so you won’t be able to use formulas to view attachments.
Jul 20, 2023 09:52 AM
Formulas no longer return valid URLs, so you won’t be able to use formulas to view attachments.
Jul 20, 2023 05:49 PM
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.