How to concat multiple value in one variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 06:52 AM
HI,
in catalog item, I have to show on 1 variable named the concatenation of 3 information from the same record (core_company_list)
-plant
-company code
-Name
below what should be appeared in the variable.
How Should I do?
thanks for your support.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 07:02 AM
Hi @florence2
https://jesusemelendezm.medium.com/concatenating-string-fields-in-servicenow-c5add52db32f
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]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 07:13 AM
Hi @florence2 ,
Just write an onChange client script, with the condition that none of these fields are empty.
var fName=g_form.getValue(first_name);//update your field name
var LName=g_form.getValue(last_name);//update your field name
var ofcLoc=g_form.getValue(office_location);//update your field name
var comm = fName + "" + LName+ "" + ofcLoc;
comm=String(comm);
g_form.setValue('comments',comm);//update your field name
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 07:15 AM
var plant=g_form.getValue('u_plant');
var comp=g_form.getValue('u_companycode');
var name=g_form.getValue('name');
var result =plant + "" + comp+ "" + name;
Kindly mark helpful/accepted if it helps you.