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.

3 Likes

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

Upvoting feature request for dynamic image alt text :point_up:

2 Likes

Hey @Fizzle,

Vote is counted :slight_smile: Thanks

Upvoting as well for dynamic image alt text :muscle:t3:

2 Likes

Your vote is counted @ft_agrinovateur, but did you check the workaround David suggested?

I tested the workaround and apparently it still works as of now. I don’t know why - it was supposed to stop working by now, but here we are.

Seems like it’s not affected by the change @dcoletta :slight_smile: and that’s cool.

The Airtable documentation is a bit unclear about whether the formula-generated URL for the attachment is supposed to work but only for a brief amount of time, or not supposed to work. I don’t think it’s safe to depend on this mechanism, but as a workaround until there’s a better way, it might be ok?

2 Likes

Agree with you :star_struck:

1 Like

Please add my vote for this feature request too! I have a lot of images on my app and I’d like to add some kind of alt text or description to them.

2 Likes

Without a robust way to do this, Softr can’t be used for projects where accessibility is a critical concern (which should be pretty much every project).

This is a complete roadblock - a major issue.

Having said that, on the face of it, this should not be too hard for Softr to sort out.

You just need to be able, optionally, to point the Softr template to a single line Airtable text field containing the Alt Text whenever you specify an image. Job done.

The workaround proposed is very clever (thanks @dcolleta) but looks like it would have some serious limitations in terms of integration with the various templates.

1 Like

upvoting. this is almost the year 2024 and alt text is quite necessary for accessibility