- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2016 03:38 AM
Hey,
Could anyone please advise on how to get the display value for any reference field (CI field) using the onSubmit Catalog Client script?
Using g_form.getValue('u_device_ref_1'), I am getting the sys_id of this field
And with g_form.getDisplayValue('u_device_ref_1'), I am getting blank value.
Thanks in Advance,
Rathika.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2016 03:56 AM
HI Rathika,
You can use g_form.getDisplayBox('field_name');
Thanks
Prashant
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.
********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect
Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2021 12:46 AM
You can use g_form.getDisplayValue() on the catalog client script, but make sure that the 'Isolate script' Field is set to false if it's not working on true.
In this Client script, the Current_position field is a reference type field and I am copying its value on the future_position field.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2021 08:30 AM
That is not best practice an may not always work. g_form.getDisplayBox or using a script include is the best way to go.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2021 11:24 PM
g_form.getDisplayBox is not working for me in the catalog client script. And, the example I gave above is for catalog client script only. I'm not sure if it will work on other client scripts as well.
P.s. - I Agree that Script Include will be the best practice for getting the display value of a reference field in the client script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2021 12:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2021 01:58 AM