Replace string with image URL in data field

I have some data fields that will use image as icons. Is there a way to use a smail string of text that will be replaced by the image html?

Template column will not work since data is different in each row.

Thanks again!

Why doesn’t the template column work? Can you provide a sketch or screenshot of what you want to achieve?

1 Like

image

Each line would be a different data row.

I think you need to use a custom collection component. You need to organize your data from the tabel editor side.

No, that wouldn’t work. My current data fields for the above example are something like this: Some text <img src=“…”…> some more text <img src=“…”…> <img src = …"…>.

What I would like to do is to write something like:

Some text {blue} some more text {black} {blue}

and make it replace {blue} and {black} for their respective tag.

Are you querying HTML code or do you want to replace data dynamically? I don’t understand what you mean.

I’m not querying. I just want to replace so I don’t need to have a loooong code in each cell. Sorry if I don’t make myself clear, I have almost none experience with coding.

If you want to replace, you need a template column to replace your image URL. Why do you say it doesn’t work?
If you want each row to be different, you need a custom collection component as a list and add a richtext component to display the value of your template column in the form of HTML code. Here’s how it works.

Template columns can also have dynamic template text. If you have a basic text column with the text layout in each row, then you can feed that into a template column and still set up your replacement values.

1 Like

I’m probably doing something wrong.


Here are my 2 columns. The first one has the text with {Blue} and {Black} strings to be replaced.

The second one is the template column, where the design is just the first column, but on replacements I have both {Blue} and {Black}.

Since this text is not addressed on the template design, it’s not replaced.

I don’t know how to do it in another way… If someone can explain in details, it would be awesome.

Thanks.

You need to first point the Template value in the Template column directly at the Main column. Click the 3 dots to select the column. Then configure your Replacements to only replace Black and Blue. Main is your actual template, which can be different in each row. The template column just reads that template, and then takes care of the replacements.

2 Likes

Jeff, do you know the meaning of the piece of cake that appears next to my name? :smile:

Found my error. Thanks to both of you @Jeff_Hager and @Himaladin !!

2 Likes

It’s the anniversary of the day you registered in this community. August 12, 2020. :wink:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.