- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2015 07:18 AM
Hi All,
I have a script with a hard code Sys ID which displays a particular record from the ServiceNow data. I am not sure if this record (object) is a page, iframe or what. I am looking for a way to query the ServiceNow database as a System Administrator to find this object.
How can I use the out of the box tools/applications within the ServiceNow to find this object/record to trace it's whereabouts in the database?
Thanks a bunch.
Brian
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2015 07:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2017 06:41 AM
Hi, I've added a script to my blog which you might find useful to find the table
https://servicenowgems.com/2016/08/15/finding-a-sys_id-across-the-system/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2018 06:53 AM
HI Ahmed,
I have a sysid, i don't know the table how can I find the corresponding record?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2018 02:26 AM
Hi,
Put this in script include:
function findAnywhere(sysid, html) {
if (html !== true && html.toString().toLowerCase() !== 'true') {
html = false;
}
var check;
var tableName;
var url = gs.getProperty('glide.servlet.uri');
var table = new GlideRecord('sys_db_object');
//Make sure we're not looking at a ts (text search) table.
table.addEncodedQuery('sys_update_nameISNOTEMPTY^nameISNOTEMPTY^nameNOT LIKEts_^nameNOT LIKEsysx_');
table.query();
while (table.next()) {
try {
tableName = table.getValue('name');
check = new GlideRecord(tableName);
if (check.get(sysid)) {
url += tableName + '.do?sys_id=' + sysid;
if (html) {
return '<a href="' + url + '">' + url + '</a>';
}
else {
return url;
}
}
} catch(ex) {
//gs.log(ex.message);
}
}
}
and in back ground script :
gs.print(findAnywhere('9ac3fd684fe1020066168ab18110c793'));
* @param sysid {String} The sys_id of the record you're looking for.
You will get a URL With Table name.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2019 11:11 PM