Scripting reference
The objects and globals available to server and client scripts, one page per object, with each method's signature, result and an example.
This reference is for developers who write scripts in Servicely: triggers, UI events, script libraries, jobs, transforms and custom endpoints. Each page covers one object, lists its methods with the version they appeared in, and shows each script beside the result it returns.
Where a script runs and which globals it receives is explained in Where scripts run in the Administrator guide.
Start here
- Querying tablesHow to read records in server scripts: single lookups, simple and complex queries, iteration, empty results, batches and safe traversal.Developer
- TableMethods of the Table object, which queries a table, reads its schema and creates, counts and deletes its records in server scripts.Developer
- TableRecordMethods of the TableRecord object, which reads, sets, saves, clones and deletes one record in server scripts.Developer
- DateTimeConstructors, constants and methods of the DateTime object, which creates, compares, shifts and formats dates and times in server scripts.Developer
- HTTPMethods of HTTP, GetRequest, HttpRequestWithBody, HttpResponse and HttpResponseBinary for sending HTTP requests from server scripts.Developer
In this section
Querying tables
How to read records in server scripts: single lookups, simple and complex queries, iteration, empty results, batches and safe traversal.
Developer3 minScripting recipes
Server script recipes for attachments over HTTP and base64, and for testing a record against a condition stored on another record.
Developer2 minTable
Methods of the Table object, which queries a table, reads its schema and creates, counts and deletes its records in server scripts.
Developer2 minTableRecord
Methods of the TableRecord object, which reads, sets, saves, clones and deletes one record in server scripts.
Developer2 minField and Relation
Methods of the Field and Relation objects, which read a value's history and metadata and manage related records in server scripts.
Developer2 minQuery operators and criteria
The query operators that filter Table and Aggregate queries in server scripts, with their aliases and how to combine them.
Developer2 minQuestions
Methods of the Questions and QuestionResponse objects, which read the catalog questions and answers of a record in server scripts.
Developer2 minTableProtected and TableChecks
TableProtected, the predefined TableChecks sets and the option methods that decide which permissions, validations, triggers and events a script applies.
Developer2 minAggregate
Methods of the Aggregate object, which counts, sums and groups table records in the database from server scripts.
Developer2 minDateTime
Constructors, constants and methods of the DateTime object, which creates, compares, shifts and formats dates and times in server scripts.
Developer2 minDateTime formatting and time zones
The pattern letters, style tokens, locales and time zone IDs that DateTime accepts when it formats, parses and converts dates in server scripts.
Developer2 minDuration and Period
Constructors and methods of the Duration and Period objects, which measure and build lengths of time in server scripts.
Developer1 minBigDecimal
Constructors and methods of BigDecimal for exact decimal arithmetic, and of Money for formatting amounts as currency, in server scripts.
Developer1 minuser and User
Methods of the server-side user object and the client-side User object, which read the signed-in user's details, roles, groups and properties.
Developer1 minClient form API
Methods of current in client scripts, which read and set form fields, make them required, read-only or hidden, and show or hide layout elements.
Developer2 minWorkflow
Methods of the Workflow object, which performs and forces workflow transitions, moves records between activities and answers approvals from server scripts.
Developer1 minJob
Methods of the Job object and of job requests, which run a server script in the background on a job queue.
Developer1 minLogger
Methods of the Logger global and of the loggers it creates, which write leveled messages from server scripts and change log levels across the cluster.
Developer2 minJournal
Methods of journal fields and journal entries, which read a record's journal history and add entries from server scripts.
Developer1 minTranslation
The functions that localise messages in scripts and components, and the Translation object that lists, generates, copies and deletes localised messages.
Developer2 minApplicationPropertyManager
Methods of ApplicationPropertyManager, which reads and creates application properties and returns the instance's base URL and ID in server scripts.
Developer1 minRealmUtils
Methods of RealmUtils, which renumbers realms and re-stamps realm-separated records after the realm tree changes, in server scripts.
Developer1 minHTTP
Methods of HTTP, GetRequest, HttpRequestWithBody, HttpResponse and HttpResponseBinary for sending HTTP requests from server scripts.
Developer2 minAttachmentManager
AttachmentManager methods for moving, copying and validating attachments in server scripts, and the administrator methods for attachment storage.
Developer1 minMarkupConverter and HtmlUtils
Convert between Markdown and HTML with MarkupConverter, and extract text from or edit HTML with HtmlUtils, in server scripts.
Developer1 minWebsocket
Websocket methods that send messages from a server script to signed-in users' browsers, for example to drive a progress dialog.
Developer2 min