Adding a line of blank space between two variables

Jason Stephens
Kilo Guru

How would I a line or two ("returns") between two variables in a record producer? I have two variables that I want to use to populate the short description. I know how to append them to each other, but is there a way to add a couple of lines of blank space between the two so they look like this....

var1

var 2

Instead of this...
var1 - var 2

5 REPLIES 5

MB26
ServiceNow Employee
ServiceNow Employee

I am assuming that you are not meaning two variables on the form, but rather take the two variables and via javascript populate them in the description, or some multi line text field. To do this use the "\n" in javascript. So it may look like this..



current.short_description = "Variable 1: " + var1 + "\nVariable 2: " + var 2;


Just to clarify, to do this you will need to use a multi line text field, not a short description (single line) text field.


I meant to say description, not short description. Thank you very much for the help.


artduck
Tera Contributor

There's also the ability to add blank space on the same line via HTML code



<span style="padding-left:20px">




you can adjust the px to suite your need.




MD


Anurag Tripathi
Mega Patron
Mega Patron

Hi Jason,



I have something similar for me working, its a client script code but i am sure it would work just fine in the Record Producer Script too


var a = "haha";


var b = "HAHA"


var y = a+"\n\n"+b;


g_form.setValue('description', y);



output in description field is somehting liek this



haha



HAHA


-Anurag