- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2023 08:50 PM
BR:
g_scratchpad.v=current.caller_id.location.getDisplayvalue();
CS:
ONLOAD
var v=g_scratchpad.v;
alert("the caller location is",v);
didn't get output, please share any correction?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2023 10:15 PM
Hi @keerthana ,
try below script it will work.
1. Display Business rule
(function executeRule(current, previous /*null when async*/) {
g_scratchpad.v = current.caller_id.location.name;
})(current, previous);
2.On load client script
function onLoad() {
var v=g_scratchpad.v;
alert("the caller location is" +v);
}
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2023 09:59 PM
Check if user has location populated in your instance.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2023 10:07 PM
how to check?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2023 10:15 PM
Hi @keerthana ,
try below script it will work.
1. Display Business rule
(function executeRule(current, previous /*null when async*/) {
g_scratchpad.v = current.caller_id.location.name;
})(current, previous);
2.On load client script
function onLoad() {
var v=g_scratchpad.v;
alert("the caller location is" +v);
}
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2023 10:24 PM
thanks. i got ans....