I have a sysid, i don't know the table how can I find the corresponding record?

kiranped
Giga Contributor

I have a sysid, i don't know the table how can I find the corresponding record?

1 ACCEPTED SOLUTION
5 REPLIES 5

bernyalvarado
Mega Sage

You could do a script that navigates through all the tables of the system, for instance, perhaps doing a group in the table field for the sys_dictionary table and then using each table name within a new GlideRecord(tableArray[i]) so that you can then test if a .get() is successful


Shishir Srivast
Mega Sage

SaschaWildgrube
ServiceNow Employee
ServiceNow Employee

 

The DevTools app contains powerful tools and a code library for ServiceNow developers.

One of them is the GetTableFromSysId() function. Check it out here:

https://github.com/saschawildgrube/servicenow-devtools/blob/master/update/sys_script_include_fc26194...

It excludes a number of tables from the search and searches a number of tables first, where I believe the likelihood of a match is higher - which makes it faster in many cases than the earlier proposed solutions.