Format list to one entry per line

I’m grabbing a list of files from a row-column in my table, but by default it is formatted as comma separated list. Does anyone have a good way to have a linebreak between each separate entry?

hi @Stian_Ovesen , we did not see you for a while, good to have you back.

did you try somehing like

files.forEach(
Format(
"{1} {2}",
currentvalue,
LineBreak()))

Did not test the code, but so you get the idea, cheers,christiaan

Thank you for your suggestion, Christiaan!
It might that I misunderstood you, but this was the result from your code snippet:

hi @Stian_Ovesen , I guess you mean to say that there is too much now between the files

files.forEach(
currentvalue.bulletlist())

Is this prettier?

Nope. It still won’t use linebreaks properly.

Is your initial file list a comma seperated list (CSV) held all in one Row/column of your table or are the files each already mentioned in their own row?

Hello everyone!

Try this formula

asset_select.Files.Join(LineBreak())

This fixes the formatting, but it also converts everything to text, making the files non-clickable.

The files are just dumped into a file-column:

did you considering sharing a demo doc? @Stian_Ovesen ?
we try hard to help, but it feels impossible without concrete material.
merci, christiaan

I’m sorry. Of course I’ll share a demo doc:

this is an option

thisRow.Files.ForEach(CurrentValue.Concatenate()).BulletedList()

or if you want to distribute files over rows using a button:

thisRow.Files.ForEach(
  thisTable.AddRow(
    thisTable.Files,
      CurrentValue
)
)

does this help @Stian_Ovesen ?

2 Likes

That works! Thanks a lot.

I’ll see if I can figure out a way to make the list a bit prettier as well.

okay, glad we solved it @Stian_Ovesen
you can use Format() to make it look better have fun :wink:
cheers, Christiaan

Format() will output text, so I don’t think that works in this scenario. In any case, thanks for all the assistance!

Looks like the Wizard of Ghent (Christiaan) got it working for you. I thought you needed the list taken from a list in one row/column and turned into entries in indiviual rows of a column, which I’ve had to do a bit of.

1 Like

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