Preserving multi-line text formatting in loop and merge | XM Community
Solved

Preserving multi-line text formatting in loop and merge

  • 2 April 2024
  • 2 replies
  • 33 views

Badge +2

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? 

icon

Best answer by TomG 2 April 2024, 19:50

View original

2 replies

Userlevel 7
Badge +27

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.

Badge +2

Works perfectly. Thank you so much!

Leave a Reply