- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2021 03:13 AM
Hello,
I wrote a script where I can check if a record exists with the following condition and it is not able to find.
var methods = new GlideRecord("incident");
var returnValue = methods.get("caller_id", "Bud Richman");
gs.addInfoMessage("the record that is to be returned is available " + returnValue);
It is returning false even though there is record with the scenario
Regards
Suman P.
Solved! Go to Solution.
- Labels:
-
Change Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2021 03:14 AM
Hi there,
methods.get("caller_id", "Bud Richman");
caller_id is a reference, so sys_id. You are searching on a string though. That won't work.
So either search on the sys_id, or use caller_id.name
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2021 03:14 AM
Hi there,
methods.get("caller_id", "Bud Richman");
caller_id is a reference, so sys_id. You are searching on a string though. That won't work.
So either search on the sys_id, or use caller_id.name
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2021 03:16 AM
And just to add, even if this would work, what if "Bud Richman" is a Caller in multiple incidents? You are only returning 1 incident with this script. Or is this just to validate, if Bud Richman has any incidents where Bud is registered as caller?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2021 03:23 AM
Hi Mark,
Nothing specific, I am just making sure GlideRecord works for me for learning.
Regards
Suman P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2021 03:23 AM
Hi,
you can check points mentioned by Mark around sys_id for caller
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader