The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
SlightlyLoony
Tera Contributor

find_real_file.pngIf you've done any scripting of Service-now.com, you've almost certainly run into the notion of a sys_id: the unique 32-character long identifier that is the primary key for every record in every table of the Service-now.com database. You may even already be aware that every sys_id is an example of a GUID (Globally Unique IDentifier, pronounced either GOO-id or GWID). But do you know how a GUID is made, and what all its characters mean?

And do you know that not all sys_ids are created equally?

GUIDs are (usually) a sequence of 32 hexadecimal digits. Since each hexadecimal digit represents four bits, and 4 â‹… 32 = 128, that means that a standard GUID is actually a 128 bit number (roughly the same as a 1038, or 38 digit, decimal number). This number is generated at the moment any given record is first inserted. The 128 bits are built up from four separate 32 bit numbers, as follows:

  • The IP address of the instance's server (whichever node is inserting the record)
  • The GMT system time, to the nearest millisecond
  • A number derived from the GlideRecord (a hash of its properties)
  • A pseudo-random number

Each of these elements contributes to making each GUID unique.

Here's how sys_ids are not necessarily created equally: there are a few records in Service-now.com (all from the earliest days of the product) where the sys_ids were hand-crafted. A sys_id is just a string, and the only requirement is that they be unique within any given table, so this was possible to do. If you grub around the system enough, you might actually find one with someone's name as the sys_id!

3 Comments