How do I preserve line breaks in an essay question | XM Community
Skip to main content

Hi,
I've seen some similar questions but nobody seems to have addressed simply capturing what a respondent enters in an Essay text field if the respondent happens to include a line break:
line 1
line 2
line 3
Can anyone provide me with guidance on how to keep that formatted as entered? I don't know Java but I've had some success copying scripts from this forum when it's very simple and clear what do.
Thanks!

Are you talking about preserving line breaks when you export the data?


I would love to keep them anywhere. They're not in the survey when I feed the answer to that question back to the respondent (on screen or in an email action), they're not in my Data/Analysis view and they're not in Excel when I export.


In terms of data export, you can preserve the line breaks if you select "More Options" and uncheck "Remove line breaks" upon export.
Screen Shot 2020-12-18 at 1.40.23 PM.pngThe piped text is a bit tricker...let me get back to you on that one.


Wow! This is fantastic, thank you! I was really concerned that those breaks were already lost because they don't display in the piped text. Besides solving part of the problem, this suggests that the other part should be solvable somehow. I really appreciate your effort! I can't write Javascript myself but if the solution is there, I can copy/paste!


Leave a Reply