- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2018 12:53 PM
Hello Team,
I am new to service now scripting and need help to concatenate 3 fields in a different or unique filed.
I have created a table named :My Table [u_my_table] with few fields mentioned below :
Incident Number => Reference Type from the incident tabe
Priority => String Type
SLA Definition => Reference Type from contract_sla table
Assignment Group => Reference Type -Group from incident table
Unique Key [NEW FIELD] = > Concatenate (Incident Number, Priority, SLA Definition)
Can anybody guide me with the scrip to concatenate these three fields ? And also am not getting any data to the new table create (u_my_table) ?
Kindly help me with the script for the same.
Thank You.
Solved! Go to Solution.
- Labels:
-
Reporting

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2018 08:01 AM
Write a before business rule
when to run: Before insert and update
Conditions: Incident Number Changes OR SLA Definition changes OR Priority changes
Script: current.<field name of unique key>=current.<field name of incident number>.getDisplayValue()+current.priority.getDisplayValue()+current.<field name of sla definition>.getDisplayValue();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2018 02:17 PM
If you are using Kingston you can make use of function fields Create a new field from the table definition Mark Function field true In the function definition set it as glideFunction:concat([fieldName], ' ',[fieldName], ' ',[fieldName])
Above, the ' ' will provide a single white space. Remove those to have the concatenation appear as one single string with no spaces. Example [fieldName],[fieldName],[fieldName]
How, when, and what data do you want on your new table?
Edit: syntax correction
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2018 07:54 AM
Functions are a good use here, but that isn't quite the right syntax. Be sure to check the docs.
If a GlideFunction doesn't work, try a BR that concatenates these into a new field when any of these changes. That way the calculation is only executed when there is a change.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2018 08:01 AM
Write a before business rule
when to run: Before insert and update
Conditions: Incident Number Changes OR SLA Definition changes OR Priority changes
Script: current.<field name of unique key>=current.<field name of incident number>.getDisplayValue()+current.priority.getDisplayValue()+current.<field name of sla definition>.getDisplayValue();