Dynamic text generation from list

Hi Everyone,

I ran into this issue that I’m unable to wrap my head around.

Basically, I’ve a list of strings and I need to generate a code block similar to this:

list = [“a”,“b”,“c”]

code{
{
item = “a”
},
{
item = “b”
},
{
item = “c”
}
}

Any idea what is the best way to achieve this? Thanks in advance.

Sunita

Hey Sunita, I think you can use the operator :format as text to achieve this.

In the text you can combine static text with dynamic values, so you can create something like:

code{
{
item = “dynamic value a
},

Here is an example. Cheers!

Thanks @lipshow. I was able to get it working with your suggestion. Appreciate your help!!

1 Like

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