- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 01:10 PM
What are some excellent ways to search through ALL (or most) ServiceNow Tables for a know sys_id value?
Such as this one: ae706e530a96001a00120cb31709c1d6
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
The best way, honestly, is to install and use the "SN Utils" utility.
Then you can just type Ctrl + / + sys_id
Example: / ae706e530a96001a00120cb31709c1d6
And it will take you right to the record in ServiceNow.
Not sure why this is not a built-in function and requires a 3rd party utility.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 01:30 PM
Hi there,
something like this ?
function searchSysIDAcrossAllTables(sysID) {
var allTables = new GlideRecord('sys_db_object');
allTables.query();
while (allTables.next()) {
var tableName = allTables.getValue('name');
var gr = new GlideRecord(tableName);
if (!gr.isValid()) {
// Skip invalid tables (e.g., sys_db_object itself)
continue;
}
gr.addQuery('sys_id', sysID);
gr.query();
if (gr.next()) {
gs.info('Found sys_id ' + sysID + ' in table ' + tableName);
}
}
}
// Call the function with the known sys_id value you want to search
searchSysIDAcrossAllTables('ae706e530a96001a00120cb31709c1d6');
Mark as correct and helpful if it solved your query.
Regards,
Tushar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2025 05:26 AM
G24, What if you get this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
The best way, honestly, is to install and use the "SN Utils" utility.
Then you can just type Ctrl + / + sys_id
Example: / ae706e530a96001a00120cb31709c1d6
And it will take you right to the record in ServiceNow.
Not sure why this is not a built-in function and requires a 3rd party utility.
