Virtual Agent Bot Response Text Display Issue with Line Breaks showing as /n

Ned Sanderson
Giga Contributor

Hi All

I'm building a new topic today and when I enter a list of steps in a bot response text component, it runs the text together and shows the line breaks as /n.  This is consistently happening within the topic.  Wondering if you know of a solution.  Thanks!

find_real_file.png

9 REPLIES 9

PeterWiles
Kilo Sage

I would suggest using the HTML component to display the information from the screen shot.

Alternative is to use the gs.getMessage() and format the message in there.

nilimadesai
ServiceNow Employee
ServiceNow Employee
Hi Ned,
 
You need to use '\n\n' in your message string. Each \n will cause a line break. Wrapping the message in gs.getMessage() is also recommended. 
 
So something like below should work:
 
return gs.getMessage('This is a test') + '\n\n' + gs.getMessage('Do you see a line break?');
or,
return 'This is a test' + '\n\n' + 'Do you see a line break?';
 
If I have answered your question, please mark my response as correct and/or helpful.
 
Regards,
Nilima
 

Muralidharan BS
Mega Sage
Mega Sage

Hi Ned, 

Can you give this a try, 

find_real_file.png

Thanks

The <br/> works!  Just wondering why I have to use this now....