Skip to main content
Solved

Format the text in a rollup field (Concatenate?)

  • June 13, 2022
  • 3 replies
  • 95 views

Forum|alt.badge.img+9

Is there a way to format the items in the rollup field to look like this (including brackets on either side):

[“Choice1”,“Choice2”,“Choice3”,“Choice4”,“Choice5”]

I have this formula but it does not work in a rollup field:

'["' & 
SUBSTITUTE(
  Choices,
  ', ',
  '","'
) & 
'"]'

Then I found this sample code:

IF(
  ARRAYJOIN(values),
  "- " & ARRAYJOIN(values, "\n- ")
)

But I can’t figure out how to combine them without an error.

IF(
  ARRAYUNIQUE(values),
  '["' & ARRAYUNIQUE(values,   ', ',
  '",") & 
'"]'
)

All these “,”"’’ are making me go cross eyed. Please help me! :rofl:

Best answer by Kamille_Parks11

Still trying different configurations, but I still can’t get it to work. What am I doing wrong? Is this even possible?


Your last formula is close. Try:

IF(
  values, 
  '["' & ARRAYJOIN(ARRAYUNIQUE(values), '", "') & '"]'
)

3 replies

Forum|alt.badge.img+9
  • Author
  • Inspiring
  • June 14, 2022

Still trying different configurations, but I still can’t get it to work. What am I doing wrong? Is this even possible?


Kamille_Parks11
Forum|alt.badge.img+27

Still trying different configurations, but I still can’t get it to work. What am I doing wrong? Is this even possible?


Your last formula is close. Try:

IF(
  values, 
  '["' & ARRAYJOIN(ARRAYUNIQUE(values), '", "') & '"]'
)

Forum|alt.badge.img+9
  • Author
  • Inspiring
  • June 14, 2022

Thank you! I don’t know why I didn’t use both arrayjoin and arrayunique.