What is a Sys ID (sys_id) ?
Sys ID (sys_id) is a 32 character Global Unique ID (GUID) that is found in every table in ServiceNow. To understand more on how and where the Sys ID is being used you also need to know that everything (every component) in ServiceNow is stored in one or more tables in ServiceNow which includes systems tables and any custom tables. By Global Unique ID means, The id that was generated in one instance will never be generated in any other ServiceNow instances. Below is an example sys_id from a developer instance.f0c3d9754f25cb0039697f75f110c79a
How to retrieve a Sys ID ?
1. Copy from the Form / List : Form and List are the two default components that comes with every table in ServiceNow. Sys ID can be retrieved from a form using the below steps.1. Open the Form of a record /List of records from from the table.
2. Right click on the form header / record (in list view) and select the option 'Copy sys_id'.
3. The Sys ID is captured to your clipboard and can be used wherever required.
2. Right click on the form header / record (in list view) and select the option 'Copy sys_id'.
3. The Sys ID is captured to your clipboard and can be used wherever required.
![]() |
| From the FORM |
![]() |
| From the LIST |
2. From the URL : Whenever a record (data record / component) has been opened, The Sys ID can be found in the URL which was being used as a parameter.
3. Using Script : The Sys ID will be used in various scenarios. One of them would be using it in the scripts. Below is a sample script that can be used to get Sys ID on an incident record INC0009009.
var grInc = new GlideRecord('incident');
grInc.addQuery('number','INC0009009');
grInc.query();
if (grInc.next()) {
gs.info(grInc.sys_id);
} When and Where Sys ID can be used ?
The are multiple other ways too how you can retrieve a sys_id from any table or any other component in ServiceNow. Sys ID can really come handy in various scenarios. One good example where Sys ID can be used is to do a database transaction as above.Hint : A new Sys ID can be generated using gs.generateGUID().


Comments
Post a Comment