0% found this document useful (0 votes)
2 views3 pages

ServiceNow Admin Scripting Reference Guide

This document serves as a comprehensive technical field guide for ServiceNow system administration and Glide scripting, covering core architecture, data models, and execution mechanics. It outlines essential patterns for GlideRecord and GlideAggregate, as well as the evaluation order for Access Control Lists (ACL) and the update set packaging and deployment workflow. Key concepts include dot-walking, server-side vs. client-side execution, and best practices for querying and managing data within the ServiceNow platform.

Uploaded by

dikshith.718
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

ServiceNow Admin Scripting Reference Guide

This document serves as a comprehensive technical field guide for ServiceNow system administration and Glide scripting, covering core architecture, data models, and execution mechanics. It outlines essential patterns for GlideRecord and GlideAggregate, as well as the evaluation order for Access Control Lists (ACL) and the update set packaging and deployment workflow. Key concepts include dot-walking, server-side vs. client-side execution, and best practices for querying and managing data within the ServiceNow platform.

Uploaded by

dikshith.718
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ServiceNow System Administration & Glide Scripting

Comprehensive Platform Reference & Technical Field Guide

1. Core Architecture & Data Model

• System Dictionary ( sys_dictionary ): Stores core metadata definitions for every table and field existing
across the ServiceNow instance.
• Table Hierarchy & Inheritance:
◦ Base tables (e.g., task , cmdb ) supply foundational schema and common fields to extended child
tables (e.g., incident , problem , change_request ).

• Sys ID: A 32-character globally unique alphanumeric identifier (GUID) assigned to every individual record
database-wide.
• Dot-Walking: Syntactical method for traversing relationships from a primary record through reference
fields to query parent record attributes (e.g., current.caller_id.email ). Best practice dictates
minimizing deep dot-walking inside client-side logic to avoid sync HTTP calls.

2. Server-Side vs. Client-Side Execution Mechanics

Dimension Client-Side Execution Server-Side Execution

Execution
Client Web Browser / Mobile App ServiceNow Application Node / Database
Realm

GlideRecord , GlideAggregate , GlideSystem


Primary APIs g_form , g_user , g_scratchpad
(gs)

Client Scripts, UI Policies, Client Business Rules, Script Includes, Scheduled Jobs,
Script Types
Scripts in UI Actions Flow Actions

Performance Directly impacts UI load time and Affects database server performance, transactions,
Impact responsiveness and queues

3. Essential GlideRecord & GlideAggregate Patterns

Standard Query Pattern

// Query active critical priority incidents


var gr = new GlideRecord('incident');
[Link]('active', true);
[Link]('priority', 1);
[Link]();

while ([Link]()) {
[Link]('Critical Incident Found: ' + [Link]('number'));
}

Page 1 of 3
Encoded Query Pattern (Recommended for Complex Rules)

// Utilize encoded query strings copied directly from filter builders


var gr = new GlideRecord('incident');
var filter = 'active=true^priority=1^URGENT^ORDERBYDESCsys_created_on';
[Link](filter);
[Link]();

High-Performance Aggregation Pattern

// Avoid using .getRowCount() on standard GlideRecord queries for counting


var count = new GlideAggregate('incident');
[Link]('COUNT', 'category');
[Link]('active', true);
[Link]();

while ([Link]()) {
var cat = [Link];
var catCount = [Link]('COUNT', 'category');
[Link]('Category ' + cat + ' total active: ' + catCount);
}

4. Access Control List (ACL) Evaluation Order

Security rules evaluate in a strict hierarchical order. For authorization to be granted, both Table-Level and
Field-Level rules must pass.

[Request] → [1. Table-Level ACL Check] → Pass?


→ NO → [ACCESS DENIED]
→ YES → [2. Field-Level ACL Check] → Pass?
→ NO →
[FIELD HIDDEN / READ-ONLY]
→ YES →
[ACCESS GRANTED]

ACL Rule Evaluation Steps:

• 1. Roles: The requesting user must possess at least one of the defined roles.
• 2. Conditions: Declarative condition builder rules must evaluate to true .
• 3. Script: Scripted logic must set the answer variable to true .

5. Update Set Packaging & Deployment Workflow

• Tracked Customizations: Business Rules, Client Scripts, Form Layouts, Custom Tables, Workflows,
Service Catalog configurations, and Security Rules.
• Untracked Data Records: Incident, Problem, and Change data records, User accounts ( sys_user ),
Group memberships, and Transaction logs.
• Standard Deployment Lifecycle:
1. Mark Update Set as Complete on the Development environment.

Page 2 of 3
2. Retrieve Update Sets on the Target environment ( System Update Sets > Retrieved Update
Sets ).

3. Execute Preview Update Set to validate dependencies and flag conflicts.


4. Resolve or accept all reported conflicts before clicking Commit Update Set.

ServiceNow Administration & Scripting Technical Field Guide • Prepared for Knowledge Exchange

Page 3 of 3

You might also like