You are currently viewing How To Fetch sysID of Current Record?

How To Fetch sysID of Current Record?

community question

SysId is one of the fundamental of ServiceNow and there are many ways you can see it in your servicenow instance. There are many ways you can fetch sysId of any record in servicenow instance.

Get sysID from URL of form

  • Open a record of any table such as incident
  • Checkout the URL and get sys_id after the <tablename.do> as shown in below image

Get sysID from the form of table

  • Open the record on any table such as incident
  • Right click on the form header and click on “Copy sys_id”

Get sysID from list view

  • Open table in the list view
  • Right click on the record and click on “Copy sys_id” context menu action

Get sysID from script

//Code in background script
var gr = new GlideRecord('sys_user');
gr.query();
while(gr.next()){
gs.print(gr.sys_id);
}
//Output
Print sys_id of all incidents in incident table.

Leave a Reply