how to get original value instead of sys id
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2020 04:01 AM
Hi,
I am using getReference on catalog client script and also getting value fine but one of value i am getting is sys id but i want its text value ie display value not sys id . i use getDisplayValue() or display box but nothing is working
code look like..
var caller = g_form.getReference("variables.user",callback);
function callback(caller){
var location = caller.location;// getting sys id
// Need to change this sys id into display value format
g_form.setValue("variables.location",location);
}
Thanks in advance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2020 04:05 AM
Hello Vikram,
Did you tried
var location = caller.location.getDisplayValue();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2020 04:05 AM
Hello Yash,
Yes i tried it but not works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2020 04:36 AM
You can only dot walk once in the getReference.
in order to get the display value or more dot walking you should use onChange client script with GlideAjax approach
refer example below
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
‎09-21-2020 04:06 AM
Hi,
Using callback function you can perform only one level dot walking thats why it will give only sys_id.
You can use client script and script include combination.
Thanks,
Dhananjay.