Formatting content of text fields via a script

simonbourne
Kilo Contributor

I have built a Standard Change using a Record Producer to capture the information to populate various fields.

I then use a Workflow to generate tasks.  I'm using the Advance Script section in the Task Workflow Activity to creat the content of the Short description and Description within the Task similar to this.

find_real_file.png

This is fine and delivers an end product like:-

"Deploy & configure GTA Package V19.20 on  SERVERNAME  for  DATABASE  located on  SERVER"

 

I would like to be able to add more content, starting on the next line.

How do I add a Line Break to add a new sentence on the next line?

1 ACCEPTED SOLUTION

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi Simon,



Add '\n' to end where you want to go to Next line.



Thank you,
Ashutosh


View solution in original post

2 REPLIES 2

Aditya Telideva
ServiceNow Employee
ServiceNow Employee

Please use '\n' in your code for inserting a new line.


eg :   var resoNotes = "Line1\n";


                  resoNotes+="Line2\n";


  current.resoultion_notes = resoNotes ;



You can insert \n in a single line also like "Line1\nLine2", but the readability would be higher if you follow as per example.


The output would be :


Line1


Line2



Regards aditya Telidevara


Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi Simon,



Add '\n' to end where you want to go to Next line.



Thank you,
Ashutosh