Nov 16, 2020 12:36 PM
Hi all,
Could anyone help me with this please: I have 2 columns of Attachment (images) and want to do what I normally do with email addresses and dates etc; namely have a new formula field that checks whether an image exists in one field and if that’s a No, use the image from the other field (in my case as the cover in a gallery). (1 image is from a linked table field, the other a direct attachment (if exists)).
So, ‘date’ might be like this: IF({Date Published},{Date Published},{Date Accepted})
But ‘attachment’ gives me the AT field content like this: untitled.png?w=640 (https://dl.airtable.com/.attachments/a0dfdghtt8876ad82f549fadb408/2164e9ef/untitled.pngw640)
I can split/extract the field components eg get the actual URL via something like:
RIGHT(LEFT({Journal Image}, LEN({Journal Image}) - 1), LEN(LEFT({Journal Image}, LEN({Journal Image}) - 1)) - SEARCH(“https://”, {Journal Image}) + 1)
but that still doesn’t get my image usable easily (without some scripting/automation). Is there an easy way I’m missing in my approach?
Any pointers are welcome. Many thanks
Nov 16, 2020 03:52 PM
Unfortunately formulas can’t work with attached files directly. A formula reading from an attachment field can only retrieve the image name and URL, as you’ve seen. Scripting/automation is the only way to pull this off natively within Airtable.
Nov 17, 2020 05:02 AM
Thanks Justin,
I expected… but had hoped that AT might have had a little ‘switch’ somewhere that allowed handling better :winking_face:
If I’m not on the right track with pursuing this route: Native URL to Attachment - would you reply again and point me in a better direction please.
Thanks for the help. F.
Nov 17, 2020 09:51 AM
That solution you linked to will do the trick. :thumbs_up: