sys_db_object - access specific table knowing name

Jeffrey Siegel
Mega Sage

im trying to come up with a method that i can access a table's sys_db_object record if we know the table's name, i am able to get to it if i know the label, otherwise id need to know the sys_id for this table, in the function im trying to use it in. i cant get its sysid from its name.  does anyone know of any url parameters i can pass to access a table's sys_db_object directly knowing its name?

https://<<instance-name>>.service-now.com/sys_db_object.do?sys_id=<<table label>> works if we know the label, but with everything referencing table name,  this just wont work for us.

 

thanks,

 

Jeff

 

 

3 REPLIES 3

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Hi @Jeffrey Siegel ,

Are you looking for below code ?

var gr=new GlideRecord('sys_db_object');
gr.addQuery('name','incident');
gr.query();
if(gr.next()){

gs.info("https://<<instance-name>>.service-now.com/sys_db_object.do?sys_id="+gr.sys_id);
}

 

Output :-

GunjanKiratkar_0-1669131864243.png

 


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

no, unfortunately where i am working i cannot call a GlideRecord, ive even tried to call it via a script include and it wont work, i need to see if theres any url parameter i can use to access via the tables name.  The  table sys id and table label functionally work, but wont work for my need.

Oh Okay.

I have no idea about that. 

 


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy