ys_id values uniquely identify each record in your Service-now instance database. While you should never try to modify these values, it is sometimes useful to know what the sys_id value is for a particular record. This article describes the different ways of identifying the sys_id value for a particular record.

View the sys_id in your browser information bar

Since the sys_id of a record is always part of the URL linking to that record, you can see the sys_id in the information bar of your browser simply by hovering over a link to the record.

Hover sys_id

So, if the URL for an incident record looked like this…

The sys_id of that record would be this…

Copy URL menu option

The best way to actually retrieve the the sys_id for a record is just to open that record, right-click the header for the record, and select the ‘Copy URL’ menu option. This action can also be taken by right-clicking any record in a list. The sys_id value is the 32-character value immediately after ‘sys_id=’.

Copy sys_id

Business Rule

The sys_id value of a record can be found in a business rule (or any other server-side JavaScript) by dot-walking from the GlideRecord like this…

var id = current.sys_id;

Client Script

Finding the sys_id of a record in client-side JavaScript can be done like this…

var id = g_form.getUniqueValue();

Why is the sys_id -1?

A sys_id value of -1 in a URL is not actually a sys_id at all. If you see -1 as the sys_id in a URL, it indicates that a new record form will be displayed from that URL.

More information can be found about sys_id values here.