Adding a link to every list item

Basically, all I want to do is pull a list of texts (usernames) from the database and replace them with the exact same texts but wrapped with a link.

So, when I pull - @Dave and @Mike from the list of texts, I want to replace them with @Dave and @Mike but wrapped with a link. So when you click on each of them you’ll be taken somewhere else.

So far, I can only get this to work when I pull from a list that only has one text. If the list has two or more texts, I can access the texts but I can’t wrap them with a link.

23AE8540-B2C8-4157-B811-1BFA20962834_4_5005_c

^ @Asher is wrapped with a link but @johnnyrico and @Darianm3 are not.

Is there some logic I can implement that will make sure the link wraps around the username even when 2 or usernames are in the list?

Thank you

I suspect you will need to use a Regex here?

Hey @flyingbearinc

just to make sure, hit Recognize links and emails checkbox

image

I’m already doing so in the workflow to grab words beginning with ‘@’

Unfortunately, checking this did not work.

You should be able to do a Regex to find and replace them all?

That’s what I’m trying to do. However, I’m unable to wrap them all with a link.

This is what is in a text field in the database? And you want to wrap both?

Yeah, in that specific case I would just wrap the two words beginning with @. So far, I’ve only managed to do it when there is one word in the text field beginning with @

Yeah, super hard to do natively.

Do you have a text like @name1 @name2 and you need to get [url=https://google.com]@name1[/url] [url=https://google.com]@name2[/url]?
You can use find and replace with regex enabled, find @\w+ replace with [url=https://google.com]$&[/url]
This way is limited to just surround the matched strings with surrounding static text.

If you want to dynamically change the url of the link you can use extract with regex with the same pattern. That will get you a list of texts that you can compose back into a string with the operator format as text, where you can add the text you want dynamically.

So that is what it is! You learn something new everyday.

I even asked ChatGPT which told me half a dozen wrong answers to what “the thing that you matched” might be !

MDN is my preferred source for anything that runs on a browser :slight_smile:

This topic was automatically closed after 70 days. New replies are no longer allowed.