How to concatenate two fields value

vinuth v
Tera Expert

Hi All,

 

I need to concatenate two field values in the incident record short description.

On the form level I have two field one is "Issue" field and it is select box field, another field is "Short description provided" field and it is single line text.

 

In the incident record short description field I need to display the value like

Short Description: (<type of issue selected>) <short description provided>.

 

In the record producer script I tried like this

current.short_description = "(producer.issue.getDisplayValue())"+short_description; 

 

and

current.short_description = '('+producer.issue.getDisplayValue()+')'+short_description;

 

but it's not working, just I am getting short description field data.

 

Please any one provide me the input,

Thanks,

Vinuth

8 REPLIES 8

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @vinuth v 

 

https://www.servicenow.com/community/itsm-forum/concatenation-of-two-fields-in-a-table/m-p/487450

 

 g_form.setValue('<field C>', g_form.getDisplayBox('<field B>').value + ' ' + g_form.getValue('Field A'));
*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

Use this in the record producer script

current.short_description = producer.issue.getDisplayValue()+current.short_description; 
-Anurag

Hi Anurag,

 

I tried like this,

current.short_description = producer.issue.getDisplayValue()+current.short_description; 

But I wanted to display the issue data in the ()   like(issue) short description

Do this then

current.short_description = "(" + producer.issue.getDisplayValue() +")"+current.short_description; 
-Anurag