Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Formula help: 'If exist' with image attachments

Topic Labels: Formulas
2604 3
cancel
Showing results for 
Search instead for 
Did you mean: 
Frank_Dittmar
5 - Automation Enthusiast
5 - Automation Enthusiast

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

3 Replies 3

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.

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.

That solution you linked to will do the trick. :thumbs_up: