concatenation

MIck11
Kilo Contributor

I am trying to concatenate two string fields and nothing seems to be working. Anyone have any idea

 

 

14 REPLIES 14

var grade = g_form.getDisplayValue('u_grade'); //example - Grade
var step = g_form.getDisplayValue('u_step'); //example - Step

//Combine grade + step = GradeStep
var grades = grade + step ;

//Combine grade + " " +step = Grade Step
var grades = grade + " " + step ;

 

If my response is useful, Please mark the answer as correct/helpful , or let me know if you need any help.

 
Thanks,
Shakeel Shaik 🙂

dmathur09
Kilo Sage

Hi Mick,

Can you have a loot at this link - https://community.servicenow.com/community?id=community_question&sys_id=d4c77bdadbfe1f801cd8a345ca9619dd

It has the same query and has been marked as a correct answer.

Regards,

Deepankar Mathur

MIck11
Kilo Contributor

I have tried may way but is there any other way that setDiplayValue to Display on the for?

Raghu Ram Y
Kilo Sage

@MIck 

I just tried with OnSubmit Client script.. It was working fine.. if you can share your script I will look into it.

Tested Script.

function onSubmit() {
 var field1 = g_form.getValue('u_raghu');
var field2 = g_form.getValue('u_last');
var conCat = field1 + field2;
g_form.setValue('description' , conCat);
}

Good Evening, 

 

I was trying it Onchange and its suppose to get an input value from the 2 fields and display the concatenation on the third field.

 

var grade = g_form.getValue('u_grade');
var step = g_form.getValue('u_step');
var grades = g_form.getValue('u_grade_step');
grades= ('u_grade', 'u_step');