- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2020 04:43 AM
On the catalog request form, I have 3 reference fields and those fields' values should display in the 4th field with (,) comma-separated and 4th filed is a single-line text.
also tried this catalog client script it is displaying sys_id in the 4th field.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2020 04:52 AM
Try:
g_form.getDisplayBox('variable_name').value instead of g_form.getValue
Raghav
MVP 2023

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2020 04:51 AM
Can you use
var avzone1=g_form.getDisplayBox('subnet_1_av_zone').value;
var avzone2=g_form.getDisplayBox('subnet_2_av_zone').value;
var avzone3=g_form.getDisplayBox('subnet_3_av_zone').value;
Also, ensure Isolate script (not available on Form OOB but can be added or edited from List Layout) field on the Client script is set to True.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2020 04:52 AM
Try:
g_form.getDisplayBox('variable_name').value instead of g_form.getValue
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2020 05:00 AM
this should work in both native and portal
if(window == null){
var avzone1 = g_form.getDisplayValue('subnet_1_av_zone');
var avzone2 = g_form.getDisplayValue('subnet_2_av_zone');
var avzone3 = g_form.getDisplayValue('subnet_3_av_zone');
var zone = avzone1 + "," + avzone2 + "," + avzone3;
g_form.setValue('subnet_availability_zone', zone);
}
else{
var avzone1 = g_form.getDisplayBox('subnet_1_av_zone').value;
var avzone2 = g_form.getDisplayBox('subnet_2_av_zone').value;
var avzone3 = g_form.getDisplayBox('subnet_3_av_zone').value;
var zone = avzone1 + "," + avzone2 + "," + avzone3;
g_form.setValue('subnet_availability_zone', zone);
}
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
12-02-2020 05:20 AM
Thanks, Ankur it is working as expected.