Alt text for dynamic images from airtable

Hello Softr community!

Is there a way to include alt text for dynamic images?

For static images it’s super easy but I’m not finding the same option for dynamic images, specifically within a list detail block.

Thanks in advance!

I’m assuming this is impossible?

Hey @JohnK,

It is not possible currently, I will add this as a feature request.

Thanks :slight_smile:

Thanks for the response, Suzie! Standing by for the update :slight_smile:

1 Like

My pleasure @JohnK :slight_smile:

Hang on, not so fast, this is in fact doable. Here’s a quick tutorial.

Assumptions: you have a Airtable table with an field of type Attachment, named “Image”, with one image in it, and you have a field of type Single Line Text, named “Alt Text”, containing the alt text for that image.

First, add a Formula field named “Img Tag”, with the following formula:

"<img src='" & MID({Image}, 1+FIND("(", {Image}),LEN({Image})- (1+FIND("(", {Image})))&"' alt='" & {Alt Text} & "'>"

Then in Softr, in your List or List Details block, add a field of type Text, and for its Content, select the “Img Tag” field.

That should do it.

I think this could work for multiple attachments in a single field in a given record, but would require a more interesting formula in Airtable.

WARNING: It’s unclear to me whether this approach will continue to work much longer. If I am reading this Airtable support document correctly, this approach should have stopped working on November 8. However, it still seems to work. I can’t tell whether that means it’s about to stop working, or if it’s actually not affected by the change.

1 Like

Thanks so much for posting this @dcoletta, this will be an interesting learning for me :slight_smile: