how to get sys_id of multiple records ?

Mathews1
Tera Contributor

I would like to get sys_id of 100 incident records. Is there a table or any other way to get the list of sys_id for records

1 ACCEPTED SOLUTION

Just export the records to XML-->open the XML with excel



Let me know if you have any questions.



Thanks


Pradeep Sharma


View solution in original post

17 REPLIES 17

Mrinmoy Koley
Kilo Expert

You can run a query on specific table and get sys_id of all these records using GlideRecord method.


GlideRecord - ServiceNow Wiki


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Praveen,



You can export all the fields if you are in Dublin release


https://demo002.service-now.com/incident.do?EXCEL&sysparm_default_export_fields=all



Thanks,


Pradeep Sharma


Also the sys_id value of a record can be found in a background script.


Script:


findCISysID();


function findCISysID(){


grCI = new GlideRecord('cmdb_ci'); //Replace with the table name you are looking for


grCI.query();


while (grCI.next()){


gs.print('CI Name: '+grCI.name+ ', Sys ID: ' +grCI.sys_id);


}


}



Thanks,


Pradeep Sharma


Thanks Pradeep for your reponse. When I try to use the same query, report gets generated with the fields available in the current view but not the complete view.



Can you please let me know if any property has to be enabled for the same ?