How to concatenate two fields value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 03:04 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 03:07 AM
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]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 03:08 AM
Hi,
Use this in the record producer script
current.short_description = producer.issue.getDisplayValue()+current.short_description;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 03:11 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 03:14 AM
Do this then
current.short_description = "(" + producer.issue.getDisplayValue() +")"+current.short_description;