How to get record from sys_id in the application navigator?

Akshatha Ballal
Tera Expert

I have used the functionality of landing a record using a sys_id of it by typing it in the left navigation of ServiceNow in one of my previous instances.

I don't remember the version or whether it was a PDI or not. I know we can get the record of the sys id from code or URL but can someone help me and point to the right direction to get that direct functionality in my instance? I'm currently on a PDI in Tokyo version and have the SNUtils added for Chrome Browser.

3 REPLIES 3

Basheer
Mega Sage

You can use the below script in background script

//Locating sys_id in the system

findSysID('your mysterious sysid here');
function findSysID(id) {
var record = new GlideRecord('sys_db_object');
record.addEncodedQuery('super_class=NULL^nameNOT LIKEts_c_^nameNOT LIKEsysx_^nameNOT LIKEv_');
record.query();
var searchTable, name;
while (record.next()) {
name = record.name + '';
searchTable = new GlideRecord(name);
if (searchTable.isValid()) {
searchTable.addQuery('sys_id', id);
searchTable.queryNoDomain()
searchTable.setLimit(1);
searchTable.query();
if (searchTable.hasNext()) {
gs.print('Found on table: ' + name);
}
}
}
}

 

Once you know the table name, it is easy to find the record.

Please hit like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

Cheers,
Mohammed Basheer Ahmed.

Hi, this is a code based solution but the one I am looking for does not need us to do anything (or may be it does but that comes in as part of an update set?) but I'm looking more towards just typing the word sys_id in the application navigator, a placeholder comes to give the sys_id and it returns the record of that sys_id. I'm not sure what it's called

Omkar Kumbhar
Mega Sage
Mega Sage

Hello @Akshatha Ballal ,

Please find the below link which will help you.

https://www.servicenowelite.com/blog/2020/9/29/ten-methods-to-find-sysid

 

 

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.