Global Functions
Top-level functions and objects available in every SSJS execution context without any import or Platform.Load call.
These functions and objects are available globally in any SSJS script block without requiring Platform.Load or any other initialization.
Write()
Output a string to the rendered page. The primary output mechanism for SSJS.
→ void
Stringify()
Serialize any object to its JSON string representation. SFMC's equivalent of JSON.stringify().
→ string
String()
Convert any value to a string, including CLR/.NET response objects from Script.Util.HttpRequest.
→ string
Error()
Native Error constructor for creating throwable error objects with a message property.
→ object
Base64Encode()
Encode plain text to a Base64 string. Requires Platform.Load. For charset control use Platform.Function.Base64Encode().
→ string
Base64Decode()
Decode a Base64 string to plain text. Requires Platform.Load. For charset control use Platform.Function.Base64Decode().
→ string
Variable
Global object providing access to AMPscript variables. Use Variable.GetValue() and Variable.SetValue().
object
Attribute
Global object providing access to subscriber attribute values.
object
Format()
Format numbers (currency, decimals, percentages) and dates (ISO 8601, RFC 1123, custom patterns). Requires Platform.Load.
→ string
ContentArea() deprecated
Retrieve rendered content from a classic Content Area by numeric ID. Requires Platform.Load. Use sfmc:block or Content Builder instead.
→ string
ContentAreaByName() deprecated
Retrieve rendered content from a classic Content Area by name. Requires Platform.Load. Use sfmc:block or Content Builder instead.
→ string