Hi All,
Welcome back . In this tutorial we will be looking on the most important aspect in ServiceNow that is ServiceNow SYS_ID.
LEts first try to understand what is ServiceNow SYS_ID.

What is ServiceNow SYS_ID?
SYS_ID is a record unique idetifier in ServiceNow .
A unique 32-character GUID (Globally Unique ID), called a Sys ID (sys_id) identifies each record in an instance. There are various ways a record is assigned a sys_id.

When created within the application, sys_id values are unique. The Now Platform and database should manage all operations on sys_id values. The same sys_id value is never generated twice, which ensures that every record created in every table in every instance in the world has a unique identifier. If two records have the same sys_id value, it occurs as a result of the following situations:
– If a record with the sys_id was copied to the other at the database level outside of the Now Platform.
– If a record with the sys_id was copied using an Update Set or via XML, its sys_id is the same.

* Get the sys_id from the header bar
Users can locate the sys_id of a record using the header bar.
– Navigate to the record.
– Right click the header bar and select Copy URL.
– The sys_id is inside of the URL, after the parameter sys_id=. For example, the following is a URL for an Incident:
https://instance name.service-now.com/nav_to.do?uri=incident.do?sys_id=9d385017c611228701d22104cc95c371
Therefore the sys_id is 9d385017c611228701d22104cc95c371.

* Get the sys_id from a script
Users can locate the sys_id of a record using a script.

– 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.
var id = current.sys_id;

– The sys_id of a record can be found in client-side JavaScript using g_form.getUniqueValue() as shown in the following example.
function onLoad() {
var incSysid = g_form.getUniqueValue();
alert(incSysid);
}

1. Exporting data with Sys ID/GUID (Globally Unique ID)
Scenario 1 : If your business requirement is to make the sys_id field visible on the list.
1. Navigate to System UI – Lists
2. Search the Table on which you want to add the sys_id field and Open it. (Check the view on which you want to make the changes)
3. In the List Elements related list, click the New button. Populate Element = sys_id and Position with a number for the place in the list.
4. Navigate to Application Navigator and execute cache.do
5. Once you navigate back to your list, the Sys ID field will be visible.

2. Scenario 2: If your business requirement is to make the Sys ID field visible on the form.
1. Navigate to System UI – View
2. Search and Open the View you would like to modify.
3. In the Form Sections tab, filter by your table name and then open the record for the form section you would like the Sys ID field to be visible in. The top form section for every table will not have a Caption and will appear blank. This is expected behavior.
4. In the Form Section record, click the New button on the Section Elements list. Populate Element = sys_id, Type = element, and Position with a number for the location on the list.
5. Navigate to Application Navigator and execute cache.do
6. Once you navigate back to your Form, the Sys ID field will be visible.

3. Constructing a URL
1. Navigate to the list of records.
https://instance.service-now.com/problem_list.do?
2. Build your filter (If required as per business need)
https://instance.service-now.com/incident_list.do?sysparm_query=active (I have applied filter as Active is TRUE)
3. Copy URL and place into new browser window and Add &CSV&sysparm_default_export_fields=all to the end of the URL
https://instance.service-now.com/incident_list.do?sysparm_query=active&CSV&sysparm_default_export_fields=all
4. Press Enter
5. A CSV file with all fields including sys_id will get exported.

Please like follow suscribe to my channel Technomonk and press the bell icon to get the latest update on my new videos.
Till then stay happy and safe .
Have a nice day .

Regards,
Amit Gujarathi

technomonkadmin

View all posts

Add comment

Your email address will not be published. Required fields are marked *