Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

catalog task description line breaks in script

randrews
Tera Guru

if you are using an advanced script in a catalog task.. how do you insert a line break?

for example

task.description = 'This is line one';
task.description = task.description + 'what code goes here' + 'This is line two';

1 ACCEPTED SOLUTION

Your slash in front of the n is the wrong way. It needs to be \n


View solution in original post

8 REPLIES 8

Hi Aaron,

 

Can you check this please

 

In Catalog task, I am trying to modify 'Description' from workflow based on the drop  

 

if(current.varaiables.zone == "1"){
task.description = "1) XYZ"  + "\n" + "2) ABC" + "\n" "3) 123";

}

 

find_real_file.png

when i try using this script in advanced script, this is how description is showing up. Some value is showing in the  Description field, but it is not visible. what i am missing?

 

 

Thanks,

Jay 

Thanks

randrews
Tera Guru

i have also tried
"/n"
'/br'
"/br"
'/n/n'
"/n/n"
'/n/r'
"/n/r"
'&nsbr'
"&&nsbr"

all of them just get embedded into the text.


randrews
Tera Guru

THAT did it!