- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2022 05:56 AM
if i wanted to get the phone number of the caller in a query to the incident table could i dot walk
var gr = new GlideRecord(incident);
gr.addQuery('active', true);
gr.query();
while(gr.next()){
data.caller = gr.getDisplayValue('caller.phone');
is this possible , i want to display the callers phone number in the widget next to their name .
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2022 06:02 AM
Hi there,
Yes it is possible to dot-walk in any server script across the platform, including in service portal widgets. To get the data.caller object property populated properly, I would re-write your script as below:
var gr = new GlideRecord('incident');
gr.addQuery('active', true);
gr.query();
while(gr.next()) {
data.caller = gr.caller_id.phone.toString();
}
If this answer is helpful please mark correct and helpful!
Regards,
Christopher Perry
Regards,
Chris Perry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2022 06:01 AM
Hi
the code line
gr.getDisplayValue('caller.phone');
is not possible at all in ServiceNow and also makes no sense. Instead write
data.caller = gr.caller.phone.toString();
Maik

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2022 06:02 AM
Hi there,
Yes it is possible to dot-walk in any server script across the platform, including in service portal widgets. To get the data.caller object property populated properly, I would re-write your script as below:
var gr = new GlideRecord('incident');
gr.addQuery('active', true);
gr.query();
while(gr.next()) {
data.caller = gr.caller_id.phone.toString();
}
If this answer is helpful please mark correct and helpful!
Regards,
Christopher Perry
Regards,
Chris Perry