How do i add a space in this script

carlm1984
Mega Contributor

Hello All,

I am not very good at scripting and have basically copied others here to get what i need.

I am trying to create a task script to do the below, but I have "Test" as a first name and "Testing" as a surname.

I currently have the below script, which show of works but I want a space between the first name and surname?

var comp = current.variables.eur_start_date.getDisplayValue();

var first = current.variables.eur_first_name.getDisplayValue();

var last = current.variables.eur_last_name.getDisplayValue();

task.short_description = 'New Account Required for'+ ' - ' + first + last + " - " + comp;

This is how it currently shows?

find_real_file.png

How can i get about sorting this out?

Cheers in advance

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Carl,



task.short_description = 'New Account Required for'+ ' - ' + first + last + " - " + comp should be


task.short_description = 'New Account Required for'+ ' - ' + first + ' ' + last + " - " + comp


View solution in original post

5 REPLIES 5

Excellent. Let me know if that answered your question. If so, please mark it as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list. Thank you