# ServiceNow Glide API cheat sheet

Source: The Snowball (https://thesnowball.co/glide-api-cheat-sheet). 100 methods across 6 classes (GlideAggregate, GlideDateTime, GlideForm, GlideRecord, GlideSystem, GlideUser). Records last updated 2026-03-09; file generated 2026-09-30.

Written and maintained by The Snowball, not by ServiceNow. Behaviour can change between releases; confirm against the official ServiceNow API reference for your release (https://developer.servicenow.com/dev.do#!/reference).

Free to quote and reuse with attribution (CC BY 4.0): name "The Snowball" and link the page you used (for example https://thesnowball.co/glide-api-cheat-sheet).

## GlideAggregate (6 methods)

Class page: https://thesnowball.co/api/glideaggregate

| Method | Signature | Returns | Parameters | What it does | Page |
|---|---|---|---|---|---|
| addAggregate | `ga.addAggregate(aggregateType, field)` | void | aggregateType: string, field: string (optional) | Adds aggregate operations (COUNT, SUM, MIN, MAX, AVG) to GlideAggregate queries. Essential for reporting and analytics. | https://thesnowball.co/api/glideaggregate/glideaggregate-addaggregate |
| addQuery | `ga.addQuery(name, value)` | GlideQueryCondition | name: string, value: string | Filter your GlideAggregate results with addQuery(). Works identically to GlideRecord.addQuery() but for aggregate queries. Returns GlideQueryCondition. | https://thesnowball.co/api/glideaggregate/glideaggregate-addquery |
| getAggregate | `ga.getAggregate(aggregateType, field)` | string | aggregateType: string, field: string | Returns the result of an aggregate function as a string. Must be called after next() to get values for the current group. | https://thesnowball.co/api/glideaggregate/glideaggregate-getaggregate |
| groupBy | `ga.groupBy(fieldName)` | void | fieldName: string | Groups GlideAggregate results by field for COUNT, SUM, and other aggregates. Essential for reports broken down by category or assignment group. | https://thesnowball.co/api/glideaggregate/glideaggregate-groupby |
| orderByAggregate | `ga.orderByAggregate(aggregateType, field)` | void | aggregateType: string, field: string | Orders GlideAggregate grouped results by aggregate values. Essential for finding top-N groups like assignment groups with most incidents or users with highest scores. | https://thesnowball.co/api/glideaggregate/glideaggregate-orderbyaggregate |
| setGroup | `ga.setGroup(isGrouped)` | void | isGrouped: boolean | Control whether GlideAggregate groups results or returns a single aggregate across all records. Essential for handling totals vs grouped calculations. | https://thesnowball.co/api/glideaggregate/glideaggregate-setgroup |

## GlideDateTime (13 methods)

Class page: https://thesnowball.co/api/glidedatetime

| Method | Signature | Returns | Parameters | What it does | Page |
|---|---|---|---|---|---|
| addDays | `gdt.addDays(days)` | void | days: number | Add days to a GlideDateTime object in ServiceNow. Handles month boundaries and leap years automatically. Modifies the object in place. | https://thesnowball.co/api/glidedatetime/glidedatetime-adddays |
| addSeconds | `gdt.addSeconds(seconds)` | void | seconds: number | Add or subtract seconds from a GlideDateTime object. Accepts negative values for subtraction. Essential for precise time calculations in ServiceNow. | https://thesnowball.co/api/glidedatetime/glidedatetime-addseconds |
| after | `gdt.after(other)` | boolean | other: GlideDateTime | Compare GlideDateTime objects to check if one comes after another. Essential for date range validation, SLA calculations, and workflow logic in ServiceNow. | https://thesnowball.co/api/glidedatetime/glidedatetime-after |
| before | `gdt.before(other)` | boolean | other: GlideDateTime | Compare GlideDateTime objects chronologically. Returns true if this datetime is before another. Clean alternative to numeric comparisons. | https://thesnowball.co/api/glidedatetime/glidedatetime-before |
| compareTo | `gdt.compareTo(other)` | number | other: GlideDateTime | Compare two GlideDateTime objects for chronological order. Returns negative, zero, or positive values for sorting and three-way date comparisons. | https://thesnowball.co/api/glidedatetime/glidedatetime-compareto |
| getDayOfMonth | `gdt.getDayOfMonth()` | number | none | Get the day of month (1-31) in UTC from a GlideDateTime. Returns number, not string. Use getDayOfMonthLocalTime() for user timezone conversion. | https://thesnowball.co/api/glidedatetime/glidedatetime-getdayofmonth |
| getDisplayValue | `gdt.getDisplayValue()` | string | none | Returns GlideDateTime formatted for the current user's timezone and display preferences. Essential for user-facing date/time output in ServiceNow. | https://thesnowball.co/api/glidedatetime/glidedatetime-getdisplayvalue |
| getMonthValue | `gdt.getMonthValue()` | number | none | Get the month (1-12) from a GlideDateTime in UTC. Returns integer from 1 (January) to 12 (December). Essential for date filtering and calculations. | https://thesnowball.co/api/glidedatetime/glidedatetime-getmonthvalue |
| getNumericValue | `gdt.getNumericValue()` | number | none | Convert GlideDateTime to milliseconds since Unix epoch. Essential for duration calculations and date comparisons in ServiceNow server scripts. | https://thesnowball.co/api/glidedatetime/glidedatetime-getnumericvalue |
| getValue | `gdt.getValue()` | string | none | Get the internal string representation of a GlideDateTime in UTC format. Returns yyyy-MM-dd HH:mm:ss for database storage and comparisons. | https://thesnowball.co/api/glidedatetime/glidedatetime-getvalue |
| getYearValue | `gdt.getYearValue()` | number | none | Extract the four-digit year from a GlideDateTime object in UTC. Essential for date calculations, reporting filters, and business rules. | https://thesnowball.co/api/glidedatetime/glidedatetime-getyearvalue |
| setDisplayValue | `gdt.setDisplayValue(value)` | void | value: string | Sets date/time from display-format string in user's timezone. ServiceNow converts to UTC internally. Essential for handling user date input. | https://thesnowball.co/api/glidedatetime/glidedatetime-setdisplayvalue |
| setValue | `gdt.setValue(value)` | void | value: string \| Date \| GlideDateTime | Sets GlideDateTime value from string, JavaScript Date, or GlideDateTime. Converts to UTC internally. Complete guide with gotchas and working examples. | https://thesnowball.co/api/glidedatetime/glidedatetime-setvalue |

## GlideForm (21 methods)

Class page: https://thesnowball.co/api/glideform

| Method | Signature | Returns | Parameters | What it does | Page |
|---|---|---|---|---|---|
| addErrorMessage | `g_form.addErrorMessage(message)` | void | message: string | Display red error messages at the top of ServiceNow forms. Essential for client-side validation and user feedback in forms. | https://thesnowball.co/api/glideform/glideform-adderrormessage |
| addInfoMessage | `g_form.addInfoMessage(message)` | void | message: string | Display blue info messages at the top of ServiceNow forms. Learn proper usage, scope limitations, and when to use alternatives like showFieldMsg(). | https://thesnowball.co/api/glideform/glideform-addinfomessage |
| clearMessages | `g_form.clearMessages()` | void | none | Remove all info and error messages from ServiceNow forms. Essential client-side method for clearing notification messages after validation or updates. | https://thesnowball.co/api/glideform/glideform-clearmessages |
| clearValue | `g_form.clearValue(fieldName)` | void | fieldName: string | Clears field values on ServiceNow forms, including both display and sys_id for reference fields. Essential for dynamic form behavior in client scripts. | https://thesnowball.co/api/glideform/glideform-clearvalue |
| flashField | `g_form.flashField(fieldName, color, count)` | void | fieldName: string, color: string, count: number | Flash a field with color to draw user attention. Covers hex colors, flash count, timing behavior, and when to use this advanced UI feedback technique. | https://thesnowball.co/api/glideform/glideform-flashfield |
| getControl | `g_form.getControl(fieldName)` | HTMLElement | fieldName: string | Returns the DOM element for a field's input control. Use for direct DOM manipulation when standard GlideForm APIs aren't sufficient. | https://thesnowball.co/api/glideform/glideform-getcontrol |
| getDisplayValue | `g_form.getDisplayValue(fieldName)` | string | fieldName: string | Returns the display label for any field. Gets reference record display names and choice field labels, not the underlying values stored in database. | https://thesnowball.co/api/glideform/glideform-getdisplayvalue |
| getReference | `g_form.getReference(fieldName, callback)` | void | fieldName: string, callback: function | Asynchronously fetch referenced records from the client-side with full display values. Essential for loading reference data in UI scripts. | https://thesnowball.co/api/glideform/glideform-getreference |
| getTableName | `g_form.getTableName()` | string | none | Returns the table name of the current form in client scripts. Essential for shared code that handles multiple table types in ServiceNow. | https://thesnowball.co/api/glideform/glideform-gettablename |
| getUniqueValue | `g_form.getUniqueValue()` | string | none | Returns the sys_id of the current record in client-side scripts. Essential for identifying records in UI Policies, Client Scripts, and UI Actions. | https://thesnowball.co/api/glideform/glideform-getuniquevalue |
| getValue | `g_form.getValue(fieldName)` | string | fieldName: string | Returns the internal value of form fields. For reference fields returns sys_id, for choice fields returns stored value. Essential client-side method. | https://thesnowball.co/api/glideform/glideform-getvalue |
| hideFieldMsg | `g_form.hideFieldMsg(fieldName, clearAll)` | void | fieldName: string, clearAll: boolean (optional) | Hides field-level messages in ServiceNow forms. Control whether to clear just the latest message or all messages for a field. Client-side only. | https://thesnowball.co/api/glideform/glideform-hidefieldmsg |
| save | `g_form.save()` | void | none | Save a form without navigation in ServiceNow. Triggers all save Business Rules and UI Policies while keeping users on the current record. | https://thesnowball.co/api/glideform/glideform-save |
| setLabel | `g_form.setLabel(fieldName, label)` | void | fieldName: string, label: string | Dynamically change field labels on ServiceNow forms at runtime. Client-side only, temporary changes that don't affect the data dictionary. Complete reference. | https://thesnowball.co/api/glideform/glideform-setlabel |
| setMandatory | `g_form.setMandatory(fieldName, mandatory)` | void | fieldName: string, mandatory: boolean | Make ServiceNow form fields required or optional client-side with g_form.setMandatory(). Client-only changes that don't affect server validation. | https://thesnowball.co/api/glideform/glideform-setmandatory |
| setReadOnly | `g_form.setReadOnly(fieldName, readOnly)` | void | fieldName: string, readOnly: boolean | Make form fields read-only on the client side. Client-only enforcement - combine with ACLs for real security. | https://thesnowball.co/api/glideform/glideform-setreadonly |
| setSectionDisplay | `g_form.setSectionDisplay(sectionName, display)` | boolean | sectionName: string, display: boolean | Hide or show entire form sections dynamically with setSectionDisplay(). Returns boolean success status. Handles section name translation automatically. | https://thesnowball.co/api/glideform/glideform-setsectiondisplay |
| setValue | `g_form.setValue(fieldName, value, displayValue)` | void | fieldName: string, value: string \| number \| boolean, displayValue: string (optional) | Set field values on forms without saving in ServiceNow. Essential for client scripts, UI policies. Handles reference fields, display values, validation. | https://thesnowball.co/api/glideform/glideform-setvalue |
| setVisible | `g_form.setVisible(fieldName, display)` | void | fieldName: string, display: boolean | Show or hide form fields client-side in ServiceNow. Controls display without affecting values. Essential for dynamic forms and conditional visibility. | https://thesnowball.co/api/glideform/glideform-setvisible |
| showFieldMsg | `g_form.showFieldMsg(fieldName, message, type)` | void | fieldName: string, message: string, type: string | Display contextual info or error messages directly under specific fields. More precise than global messages for field validation and user guidance. | https://thesnowball.co/api/glideform/glideform-showfieldmsg |
| submit | `g_form.submit()` | void | none | Submits the form and navigates away after save, equivalent to clicking Save. Essential for custom client-side form submission patterns. | https://thesnowball.co/api/glideform/glideform-submit |

## GlideRecord (40 methods)

Class page: https://thesnowball.co/api/gliderecord

| Method | Signature | Returns | Parameters | What it does | Page |
|---|---|---|---|---|---|
| addActiveQuery | `addActiveQuery()` | void | none | Shorthand for addQuery('active', true) that filters GlideRecord queries to only return active records. Essential method for most data queries. | https://thesnowball.co/api/gliderecord/gliderecord-addactivequery |
| addEncodedQuery | `addEncodedQuery(query)` | void | query: string | Adds encoded query strings to GlideRecord filters. Copy queries from UI filter breadcrumbs. Chain multiple conditions with AND logic. | https://thesnowball.co/api/gliderecord/gliderecord-addencodedquery |
| addJoinQuery | `addJoinQuery(joinTable, primaryField, joinTableField)` | GlideQueryCondition | joinTable: string, primaryField: string, joinTableField: string | Adds a JOIN query to your GlideRecord, returning a GlideQueryCondition for filtering on the joined table. Essential for complex multi-table queries. | https://thesnowball.co/api/gliderecord/gliderecord-addjoinquery |
| addNotNullQuery | `addNotNullQuery(fieldName)` | GlideQueryCondition | fieldName: string | Adds IS NOT NULL condition to GlideRecord queries. Essential for filtering out empty reference fields and null values. Returns GlideQueryCondition. | https://thesnowball.co/api/gliderecord/gliderecord-addnotnullquery |
| addNullQuery | `addNullQuery(fieldName)` | GlideQueryCondition | fieldName: string | Add IS NULL conditions to GlideRecord queries in ServiceNow. Returns GlideQueryCondition for chaining. Equivalent to addQuery(field, 'ISEMPTY', ''). | https://thesnowball.co/api/gliderecord/gliderecord-addnullquery |
| addOrCondition | `addOrCondition(name, value)` | GlideQueryCondition | name: string, value: string \| number \| boolean | Adds OR conditions to GlideRecord queries by chaining off the GlideQueryCondition returned by addQuery. Essential for complex query logic in ServiceNow. | https://thesnowball.co/api/gliderecord/gliderecord-addorcondition |
| addQuery | `addQuery(name, value)` | GlideQueryCondition | name: string, value: string \| number \| boolean | Adds WHERE conditions to GlideRecord queries. Returns GlideQueryCondition for OR chaining. Essential method for filtering records in ServiceNow. | https://thesnowball.co/api/gliderecord/gliderecord-addquery |
| addQuery | `addQuery(name, operator, value)` | GlideQueryCondition | name: string, operator: string, value: string \| number \| boolean | Add WHERE conditions to GlideRecord queries with explicit operators. Returns GlideQueryCondition for chaining and OR operations. Server-side only. | https://thesnowball.co/api/gliderecord/gliderecord-addquery-operator |
| autoSysFields | `autoSysFields(enable)` | void | enable: boolean | Controls whether ServiceNow auto-updates sys_updated_on, sys_updated_by, and sys_mod_count on GlideRecord operations. Essential for data migrations. | https://thesnowball.co/api/gliderecord/gliderecord-autosysfields |
| canRead | `canRead()` | boolean | none | Check if current user has read access to a GlideRecord without throwing ACL errors. Returns boolean true/false for secure permission testing. | https://thesnowball.co/api/gliderecord/gliderecord-canread |
| canWrite | `canWrite()` | boolean | none | Check if current user can write to a GlideRecord before setValue/update. Prevents silent permission failures and ACL violations in server-side scripts. | https://thesnowball.co/api/gliderecord/gliderecord-canwrite |
| chooseWindow | `chooseWindow(firstRow, lastRow)` | void | firstRow: number, lastRow: number | Paginate GlideRecord results by specifying a zero-indexed row window. Essential for processing large datasets without memory exhaustion in ServiceNow. | https://thesnowball.co/api/gliderecord/gliderecord-choosewindow |
| deleteMultiple | `deleteMultiple()` | void | none | Bulk delete all ServiceNow records matching a query without Business Rules or notifications. Dangerous but fast. Learn safe patterns and gotchas. | https://thesnowball.co/api/gliderecord/gliderecord-deletemultiple |
| deleteRecord | `deleteRecord()` | boolean | none | Deletes the current GlideRecord from the database. Returns true on success. Triggers delete business rules and requires delete ACL permissions. | https://thesnowball.co/api/gliderecord/gliderecord-deleterecord |
| get | `get(sys_id)` | boolean | sys_id: string | Retrieves a single ServiceNow record by sys_id. Returns boolean. More efficient than query() for single-record lookups. Essential GlideRecord method. | https://thesnowball.co/api/gliderecord/gliderecord-get |
| getDisplayValue | `getDisplayValue(fieldName)` | string | fieldName: string | Returns human-readable display values for reference fields and choice labels. Essential for UI display and reporting in ServiceNow server-side scripts. | https://thesnowball.co/api/gliderecord/gliderecord-getdisplayvalue |
| getEncodedQuery | `getEncodedQuery()` | string | none | Returns the current GlideRecord query as an encoded query string. Essential for debugging queries, passing filters to other methods, and understanding what your query actually contains. | https://thesnowball.co/api/gliderecord/gliderecord-getencodedquery |
| getRecordClassName | `getRecordClassName()` | string | none | Returns the actual table name of the current record, different from getTableName() when working with extended tables. Essential for polymorphic queries. | https://thesnowball.co/api/gliderecord/gliderecord-getrecordclassname |
| getRefRecord | `gr.fieldName.getRefRecord()` | GlideRecord | none | Get the referenced GlideRecord from a reference field without a second query. Essential method for efficient reference field data access in ServiceNow. | https://thesnowball.co/api/gliderecord/gliderecord-getrefrecord |
| getRowCount | `getRowCount()` | number | none | Returns the number of records in a GlideRecord result set. Runs the full query to count rows. Use GlideAggregate for better performance on count-only operations. | https://thesnowball.co/api/gliderecord/gliderecord-getrowcount |
| getTableName | `getTableName()` | string | none | Returns the table name a GlideRecord was instantiated against. Essential for debugging and dynamic table operations in ServiceNow server-side scripts. | https://thesnowball.co/api/gliderecord/gliderecord-gettablename |
| getUniqueValue | `getUniqueValue()` | string | none | Returns the sys_id of the current GlideRecord. More readable than getValue('sys_id'). Essential for record lookups and relationship building in ServiceNow. | https://thesnowball.co/api/gliderecord/gliderecord-getuniquevalue |
| getValue | `getValue(fieldName)` | string | fieldName: string | Returns the internal value of a field as a string. For reference fields returns sys_id. Always returns string type even for integers and booleans. | https://thesnowball.co/api/gliderecord/gliderecord-getvalue |
| hasNext | `hasNext()` | boolean | none | Check if more records exist in your GlideRecord query without advancing the cursor. Returns boolean. Server-side only. Rarely needed — prefer next() instead. | https://thesnowball.co/api/gliderecord/gliderecord-hasnext |
| initialize | `initialize()` | void | none | Resets GlideRecord for new inserts by clearing all field values. Essential for reusing GlideRecord objects in loops to prevent data carryover between iterations. | https://thesnowball.co/api/gliderecord/gliderecord-initialize |
| insert | `insert()` | string | none | Creates a new record in the database and returns its sys_id. Triggers Business Rules and ACL checks. Essential for programmatic record creation. | https://thesnowball.co/api/gliderecord/gliderecord-insert |
| isNewRecord | `isNewRecord()` | boolean | none | Returns true if the GlideRecord hasn't been saved to the database yet. Essential for distinguishing insert vs update operations in Business Rules. | https://thesnowball.co/api/gliderecord/gliderecord-isnewrecord |
| isValid | `isValid()` | boolean | none | Returns true if the GlideRecord was instantiated against a valid table. Essential validation check—doesn't mean records exist, just that the table does. | https://thesnowball.co/api/gliderecord/gliderecord-isvalid |
| isValidField | `isValidField(fieldName)` | boolean | fieldName: string | Check if a field exists on a GlideRecord table before accessing it. Essential for dynamic field access across scopes and table versions in ServiceNow. | https://thesnowball.co/api/gliderecord/gliderecord-isvalidfield |
| next | `next()` | boolean | none | Moves the GlideRecord cursor to the next record in the result set. Returns true if a record exists, false when no more records. Essential for iteration. | https://thesnowball.co/api/gliderecord/gliderecord-next |
| orderBy | `orderBy(fieldName)` | void | fieldName: string | Sort GlideRecord query results in ascending order by field name. Essential for consistent data ordering in ServiceNow server-side scripts. | https://thesnowball.co/api/gliderecord/gliderecord-orderby |
| orderByDesc | `orderByDesc(fieldName)` | void | fieldName: string | Sort GlideRecord query results in descending order by field. Essential for displaying newest records first in ServiceNow server-side scripts. | https://thesnowball.co/api/gliderecord/gliderecord-orderbydesc |
| query | `query()` | void | none | Executes the GlideRecord database query. Required before next() iteration. No-op in before Business Rules. Essential reference for ServiceNow developers. | https://thesnowball.co/api/gliderecord/gliderecord-query |
| setAbortAction | `setAbortAction(b)` | void | b: boolean | Cancel database operations in Business Rules with setAbortAction(). The standard way to validate data and block saves before they hit the database. | https://thesnowball.co/api/gliderecord/gliderecord-setabortaction |
| setDisplayValue | `setDisplayValue(fieldName, value)` | void | fieldName: string, value: string | Sets a GlideRecord field by display value instead of sys_id. ServiceNow resolves display names to internal values on save. Perfect for reference fields. | https://thesnowball.co/api/gliderecord/gliderecord-setdisplayvalue |
| setLimit | `setLimit(maxNumRecords)` | void | maxNumRecords: number | Limits the number of records returned by a GlideRecord query. Must be called before query(). Critical for performance when you only need first N records. | https://thesnowball.co/api/gliderecord/gliderecord-setlimit |
| setValue | `setValue(fieldName, value)` | void | fieldName: string, value: string \| number \| boolean | Sets field values in memory for GlideRecord objects. Does not save to database until update() or insert() is called. Essential for data manipulation. | https://thesnowball.co/api/gliderecord/gliderecord-setvalue |
| setWorkflow | `setWorkflow(enable)` | void | enable: boolean | Control Business Rule execution during GlideRecord operations. Pass false to suppress workflows for data migrations and bulk updates. Server-side only. | https://thesnowball.co/api/gliderecord/gliderecord-setworkflow |
| update | `update(reason)` | string | reason: string (optional) | Updates the current GlideRecord and returns sys_id or null. Triggers Business Rules, writes audit history, requires valid record state. | https://thesnowball.co/api/gliderecord/gliderecord-update |
| updateMultiple | `updateMultiple()` | void | none | Bulk update all matching records efficiently without Business Rules. Critical for performance on large datasets. Bypasses ACL checks and audit. | https://thesnowball.co/api/gliderecord/gliderecord-updatemultiple |

## GlideSystem (19 methods)

Class page: https://thesnowball.co/api/glidesystem

| Method | Signature | Returns | Parameters | What it does | Page |
|---|---|---|---|---|---|
| addErrorMessage | `gs.addErrorMessage(message)` | void | message: string | Display red error banners to users in ServiceNow. Does not prevent saves - combine with setAbortAction(true) to block operations. Server-side only. | https://thesnowball.co/api/glidesystem/glidesystem-adderrormessage |
| addInfoMessage | `gs.addInfoMessage(message)` | void | message: string | Display blue info messages to users with gs.addInfoMessage(). Server-side only. Shows after Business Rules complete. Essential for user feedback. | https://thesnowball.co/api/glidesystem/glidesystem-addinfomessage |
| error | `gs.error(message, parameters)` | void | message: string, parameters: any (optional) | Logs messages at ERROR level in ServiceNow. Use for unexpected failures that need alerting. Doesn't throw exceptions, just logs to system logs. | https://thesnowball.co/api/glidesystem/glidesystem-error |
| generateGUID | `gs.generateGUID()` | string | none | Generate a 32-character GUID string without hyphens for unique identifiers outside database inserts. Returns random string using platform entropy. | https://thesnowball.co/api/glidesystem/glidesystem-generateguid |
| getCurrentScopeName | `gs.getCurrentScopeName()` | string | none | Returns the current application scope name ('global' for global scope). Essential for building scope-aware scripts that behave differently per application. | https://thesnowball.co/api/glidesystem/glidesystem-getcurrentscopename |
| getProperty | `gs.getProperty(key, defaultValue)` | string | key: string, defaultValue: string (optional) | Retrieves system property values from sys_properties table. Always returns string. Use for configurable values instead of hardcoding in Business Rules and Script Includes. | https://thesnowball.co/api/glidesystem/glidesystem-getproperty |
| getSession | `gs.getSession()` | GlideSession | none | Returns the current GlideSession object to access session data, timezone, language settings, and client information in server-side scripts. | https://thesnowball.co/api/glidesystem/glidesystem-getsession |
| getUser | `gs.getUser()` | GlideUser | none | Get the current session user as a GlideUser object to access name, email, department, manager, and roles. Server-side only. Essential for user context. | https://thesnowball.co/api/glidesystem/glidesystem-getuser |
| getUserID | `gs.getUserID()` | string | none | Get the sys_id of the currently logged-in user. The foundation for user-scoped queries and security checks in ServiceNow server-side scripts. | https://thesnowball.co/api/glidesystem/glidesystem-getuserid |
| getUserName | `gs.getUserName()` | string | none | Returns the user_name (login ID) of the current user. Essential for logging, audit trails, and user-specific logic in server-side scripts. | https://thesnowball.co/api/glidesystem/glidesystem-getusername |
| hasRole | `gs.hasRole(role)` | boolean | role: string | Check if the current user has a specific role in ServiceNow. Returns true for role members and admin users. Essential for access control in scripts. | https://thesnowball.co/api/glidesystem/glidesystem-hasrole |
| include | `gs.include(name)` | boolean | name: string | Load Script Includes dynamically into global scope with gs.include(). Server-side only method for runtime loading. Essential for legacy global scripts. | https://thesnowball.co/api/glidesystem/glidesystem-include |
| info | `gs.info(message, parameters)` | void | message: string, parameters: any (optional) | Log messages at INFO level with string substitution. Preferred over gs.log() in scoped apps. Server-side only method for debugging and auditing. | https://thesnowball.co/api/glidesystem/glidesystem-info |
| isInteractive | `gs.isInteractive()` | boolean | none | Returns true for user-driven UI requests, false for background jobs and API calls. Essential for conditional logic in Business Rules and Script Includes. | https://thesnowball.co/api/glidesystem/glidesystem-isinteractive |
| log | `gs.log(message, source)` | void | message: string, source: string (optional) | Write messages to ServiceNow's system log table. Essential for debugging server-side scripts. View logs in System Logs > All. | https://thesnowball.co/api/glidesystem/glidesystem-log |
| nowDateTime | `gs.nowDateTime()` | string | none | Returns current date and time as string in instance timezone. Essential for logging, timestamps, and date comparisons in server-side scripts. | https://thesnowball.co/api/glidesystem/glidesystem-nowdatetime |
| setProperty | `gs.setProperty(key, value, description)` | void | key: string, value: string, description: string | Creates or updates ServiceNow system properties programmatically. Use sparingly — most property changes belong in the UI, not code. | https://thesnowball.co/api/glidesystem/glidesystem-setproperty |
| tableExists | `gs.tableExists(name)` | boolean | name: string | Check if a ServiceNow table exists before querying it. Essential for dynamic code that handles optional plugins or scoped applications. | https://thesnowball.co/api/glidesystem/glidesystem-tableexists |
| warn | `gs.warn(message, parameters)` | void | message: string, parameters: object \| string \| number (optional) | Log warning messages with parameter substitution using gs.warn(). Essential for non-fatal issues that need investigation in ServiceNow server-side scripts. | https://thesnowball.co/api/glidesystem/glidesystem-warn |

## GlideUser (1 methods)

Class page: https://thesnowball.co/api/glideuser

| Method | Signature | Returns | Parameters | What it does | Page |
|---|---|---|---|---|---|
| getID | `gs.getUser().getID()` | string | none | Get the sys_id of the current user from a GlideUser object. Alternative to gs.getUserID() when working with user objects in server-side scripts. | https://thesnowball.co/api/glideuser/glideuser-getid |
