Preserving multi-line text formatting in loop and merge | XM Community
Skip to main content

I’m using a loop and merge table to show respondents different answers to questions for them to grade, many of which have many line breaks that I would like to preserve. In Excel, I have cells with answers like:

“ Line 1

  Line 2

  Line 3”

But when I past a cell like that from Excel into the loop and merge table, it splits over three rows in the table. I can remove all the line breaks in Excel, but I’d like to avoid doing that – having the formatting will make these answers a lot easier to read.

If I replace new lines in Excel with \\n or something to that effect so I get each cell into one paragraph with no line breaks, is there someway I can use Javascript/HTML in Qualtrics to then re-split the paragraph from a given cell into multiple lines when I pipe the text in? 

Replace the line breaks with an html <br> tag.  That’s all you have to do.  You can then copy them into your loop & merge setup and pipe those fields into your questions.


Works perfectly. Thank you so much!


Leave a Reply