📘 Supported APIs and methods Tap to see what you can use in the practice editor
Scripts run as server-side background scripts, written in plain JavaScript the way ServiceNow expects (var, functions, arrays, JSON, Math). Press Ctrl+Space in the editor for suggestions.
GlideRecord also GlideRecordSecure
Query: addQuery, addEncodedQuery, addActiveQuery, addInactiveQuery, addNullQuery, addNotNullQuery, orderBy, orderByDesc, setLimit, getEncodedQuery, query, next, hasNext, get, getRowCount
Read: getValue, getDisplayValue, getUniqueValue, getTableName, getRecordClassName, isValid, isValidRecord, isNewRecord, isValidField, getLimit, getLastErrorMessage
Write: initialize, newRecord, setValue, setDisplayValue, insert, update, updateMultiple, deleteRecord, deleteMultiple, setWorkflow, autoSysFields, setForceUpdate, setUseEngines, setNewGuidValue
Security: canRead, canWrite, canCreate, canDelete
Or conditions: var qc = gr.addQuery(...); qc.addOrCondition(...)
GlideAggregate
addAggregate, getAggregate, groupBy, setGroup, orderByAggregate, addHaving, plus the GlideRecord query methods
Aggregates: COUNT, SUM, MIN, MAX, AVG
Fields gr.field, dot-walking
getValue, getDisplayValue, nil, getName, getLabel, getTableName, getReferenceTable, getRefRecord, setValue, changes, changesTo, changesFrom. Dot-walk references: gr.caller_id.email
gs
Logging: info, warn, error, debug, print, log, addInfoMessage, addErrorMessage
User and system: getUserID, getUserName, getUserDisplayName, hasRole, getProperty, setProperty, getMessage, nil, eventQueue
Dates: now, nowDateTime, nowNoTZ, daysAgo, daysAgoStart, daysAgoEnd, hoursAgo, minutesAgo, monthsAgo, beginningOfToday, endOfToday, beginningOfYesterday, beginningOfThisMonth, beginningOfLast7Days, beginningOfLast30Days, beginningOfThisYear, dateDiff and more
GlideDateTime and GlideDuration
GlideDateTime: getValue, getDisplayValue, setValue, getNumericValue, isValid, addSeconds, add, addDaysUTC / addDaysLocalTime, addWeeksUTC, addMonthsUTC, addYearsUTC, compareTo, before, after, onOrBefore, onOrAfter, equals, getDate, getLocalDate, getYearUTC, getMonthUTC, getDayOfMonthUTC, getDayOfWeekUTC
GlideDuration: getValue, getDisplayValue, getNumericValue, getDayPart, getRoundedDayPart
Query operators
= != < <= > >= IN, NOT IN, LIKE, NOTLIKE, STARTSWITH, ENDSWITH, ISEMPTY, ISNOTEMPTY, ANYTHING, ON, NOTON, and javascript:gs.daysAgoStart(7) style date values in encoded queries
Not available in the practice editor: chooseWindow, addJoinQuery, applyEncodedQuery, getLink, setAbortAction, getElements, gs.getSession, setting a field with field.setDisplayValue() (use gr.setDisplayValue('field', value) instead), Script Includes, GlideAjax and client-side APIs (g_form, g_user).
Free sandbox
Run only, no gradingWhile you're deciding, someone else applying for the same role already started their 15-day plan.
No countdown, no gimmick, just a head start you can still catch up on.
🔒 Secure payment via Razorpay · Instant access after payment