- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2020 03:42 AM
How to concatenate two catalog variables value to new variable which is hidden in the catalog form, and display that hidden catalog variable in RITM form
I need to concatenate "International dailling code" and "Landline Number" into "Landline" Variable
"International dailling code" and "Landline Number" Variables are visible to user in catalog form but "Landline" variable only visible in RITM
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2020 03:46 AM
Hi Arkesh,
You can create a Before insert or update business rule against sc_req_item and filter condition to only trigger against respective catalog item i.e item | is | XYZ with script as
if(current.variables.PASS International dailling code VARIABLE NAME && current.variables. PASS VARIABLELandline Number" NAME HERE)
{
current.variables.Landline = current.variables.PASS International dailling code VARIABLE NAME + current.variables.PASS VARIABLELandline Number" NAME HERE;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2020 03:49 AM
Hi Arkesh,
So, do you have any client script written for the same as I see you get NAN?
If not you can try below business rule that runs before insert/update on the RITM table with Condition as your specific Catalog Item
Item | is | Your item name
Script"
(function executeRule(current, previous /*null when async*/) {
current.variable.landline=current.variables.internationaldialling+current.variables.landline;
//Replace above with correct variables names
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2020 03:54 AM
REPEAT 😉
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2020 03:57 AM
Few assumptions:
1) I assume your landline variable is only hidden on Catalog Form and it is shown on RITM view.
2) You must be using either onLoad catalog client script or UI policy which applies to Catalog item view for this.
If yes then you would require onSubmit catalog client script to populate that variable.
UI Type - ALL
Applied on Catalog Item View- True
Even though this variable is hidden on Catalog Item form you can set the value using g_form.setValue()
Sample script below:
Ensure you use correct variable name there
function onSubmit(){
var dialing = g_form.getValue('dialing-code-variable');
var landline = g_form.getValue('landline-number-variable');
var combined = dialing + '-' + landline;
g_form.setValue('landline-variable',combined);
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2020 04:30 AM
Hello
Thank you all for helping me,
Arkesh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2020 04:39 AM
You are very welcome Arkesh.