I have the sys_id, How to find the which record, I don't know the table name

dhineshkumar
Tera Guru

Can any one assist to me how to find the record using the sys_id, I dont know the table name.

1 ACCEPTED SOLUTION

SumanthDosapati
Mega Sage
Mega Sage

Hi @dhineshkumar ,

You can try adding "SN Utils - Tools for ServiceNow" extension in your browser. With this you can get many features out of which sysid search is one.

 

Or else run background script as mentioned in this link

 

Mark as correct and helpful if it solved your query.

Regards,

Sumanth

View solution in original post

14 REPLIES 14

Try this:
but this will search all the tables in instance.

var mySysId = 'xxxxxxxxxxxxxxxxxxxxx'; // put in your sys_id here


var table = new GlideRecord('sys_db_object');


table.query();



while (table.next()) {


       var gr = new GlideRecord(table.getValue('name'));


       if (gr.get(mySysId)) {


                   gs.log('it looks like it came from ' + gr.getValue('label'));


                   break;


       }


}

Reference: https://community.servicenow.com/community?id=community_question&sys_id=9161d72ddbdcdbc01dcaf3231f96...

 


***Mark Correct or Helpful if it helps.***

Pratik Malviya
Tera Guru
Just go to sys_metadata.list and search in for text and put your sys_id and search in banner.
Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Thanks,
Pratik Malviya

Please help me Even Try to all the ways, I search with existing record but its showing no result.

This did not work for me. Thanks for the post.

Vidya Chavan1
Tera Contributor

Hi,

You can use sys_db_object(base of all tables).

For script refer below link

https://community.servicenow.com/community?id=community_question&sys_id=bda11b6ddbdcdbc01dcaf3231f961949

 

Kind regards,

Vidya