Feb 13, 2019 02:30 AM
I have a roll-up field that rolls up a bunch of warning signs, which I want to display neatly on top of each other instead of separated with commas.
I got a formula with the following:
SUBSTITUTE({Roll up warning},’,’,’\n’)
I’ll expect it to replace all the commas with line breaks - however it just gives me an #ERROR!.
What am I doing wrong?
Feb 13, 2019 02:43 AM
Try to wrap the Rollup with ARRAYJOIN()
to convert it to text.
Feb 13, 2019 03:11 AM
It kind of works but the ARRAYJOIN() add a comma to the beginning of the text and therefor It creates a line break before the text starts.
I tried REPLACE(ARRAYJOIN({Roll up warning}),1,’ ')
But just gives me an error
Any suggestions how to get that first comma out?
Feb 13, 2019 08:04 AM
The comma is a separator so should be a ‘ghost’ value before that first comma.
REPLACE needs 4 parameters:
Feb 13, 2019 08:09 AM
The 4 parameters was the bit I was missing.
Ended up with:
SUBSTITUTE(REPLACE(ARRAYJOIN({Roll up warning}),1,1,’’),’,’,’\n’)
And it works.
Thank you
However what do you mean by i need a ‘Ghost value’ before the first comma?
Feb 13, 2019 10:19 AM
I meant that if a ARRAYJOIN returns values separated by commas, any comma should have a precedent value. Maybe I should have said should exist
(I’m not native english speaker :frowning_face: )