{
  "title": "Adobe Campaign JavaScript Reference",
  "description": "Server-side JavaScript API of Adobe Campaign Classic (v7 and v8): signatures, parameters and examples.",
  "url": "https://myrosblog.com/adobe-campaign/reference/",
  "entries": [
    {
      "name": "DOMDocument",
      "group": "XML",
      "url": "https://myrosblog.com/adobe-campaign/reference/DOMDocument",
      "summary": "Adobe Campaign's XML document: create a tree from scratch, from an object, or by parsing text. Its root is a DOMElement.",
      "signature": "new DOMDocument(rootTag: string): DOMDocument\nDOMDocument.fromJXON(obj: object): DOMDocument\nDOMDocument.fromXMLString(xml: string): DOMDocument\ndocument.createElement(tag: string): DOMElement\ndocument.root: DOMElement",
      "params": null,
      "returns": null,
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["DOMElement","queryDef"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "DOMElement",
      "group": "XML",
      "url": "https://myrosblog.com/adobe-campaign/reference/DOMElement",
      "summary": "Adobe Campaign's XML element: the type returned by queryDef and SOAP calls. Can be read and traversed.",
      "signature": "element.getElements(): DOMElement[]\nelement.getFirstElement(tag: string, attr: string, value: any): DOMElement\nelement.getAttribute(name: string): string\nelement.toXMLString(indent: bool): string\nelement.$attribute: string\nelement.hasAttribute(name: string): bool",
      "params": null,
      "returns": null,
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["DOMDocument","queryDef","getOption","NL.XTK.parse"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "NL.Locale",
      "group": "XML",
      "url": "https://myrosblog.com/adobe-campaign/reference/locale",
      "summary": "Adobe Campaign's internationalization helpers to display prices and dates (i18n).",
      "signature": "NL.Locale.formatNumber(value, format, defaultReturn): string\nNL.Locale.formatDateTime(value: number, format: object, defaultReturn: string): string\nNL.Locale.formatDateOnly(value, format, defaultReturn): string\nNL.Locale.formatPercent(value, decimalPlaces, defaultReturn): string",
      "params": [{"name":"value","type":"number","desc":"The number to format. Strings are parsed as international numbers first."},{"name":"format","type":"number | string  | object","desc":"A number of decimal places, a pattern string, or a detailed format object (See Advanced Configuration)."},{"name":"defaultReturn","type":"string","desc":"Returned when value is not a valid number. If omitted, an error is thrown instead."}],
      "returns": [{"type":"string","desc":"The number formatted according to the pattern and locale."}],
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["queryDef","DOMElement","NL.is"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "NL.XTK.parse",
      "group": "XML",
      "url": "https://myrosblog.com/adobe-campaign/reference/parse",
      "summary": "Adobe Campaign's parsing helpers to safe cast XML values.",
      "signature": "NL.XTK.parseInt(value: any, defaultReturn: any): number\nNL.XTK.parseNumber(value: any, defaultReturn: any): number\nNL.XTK.parseBoolean(value: any, defaultReturn: any): bool",
      "params": null,
      "returns": null,
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["queryDef","DOMElement","NL.is"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "NL.is",
      "group": "XML",
      "url": "https://myrosblog.com/adobe-campaign/reference/is",
      "summary": "Adobe Campaign's type helpers to check XML values.",
      "signature": "NL.isNundef(value: any): bool\nNL.isEmpty(value: any): bool\nNL.isArray(value: any): bool\nNL.isString(value: any): bool\nNL.isNumber(value: any): bool\nNL.isDate(value: any): bool\nNL.isXML(value: any): bool\nNL.XTK.isLeapYear(value: any): bool",
      "params": null,
      "returns": null,
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["NL.XTK.parse","queryDef","DOMElement"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "escapeUrl",
      "group": "Misc",
      "url": "https://myrosblog.com/adobe-campaign/reference/escapeUrl",
      "summary": "Percent-encodes a string so it can be safely placed inside a URL.",
      "signature": "escapeUrl(value): string",
      "params": [{"name":"value","type":"string","desc":"The raw value to encode."}],
      "returns": [{"type":"string","desc":"The percent-encoded string, safe for a URL."}],
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": null,
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "execute",
      "group": "Http",
      "url": "https://myrosblog.com/adobe-campaign/reference/execute",
      "summary": "Run an HTTP query from the instance to an external URL.",
      "signature": "execute(hasProxy?: bool, async?: bool, reuseaddr?: bool, context?: object, timeout?: int): void",
      "params": [{"name":"hasProxy","type":"bool","desc":"Use proxy. Default to false."},{"name":"async","type":"bool","desc":"Fire the query in asynchronous mode. Default to false."},{"name":"reuseaddr","type":"bool","desc":"Allow the underlying socket to reuse local addresses. Default to false."},{"name":"context","type":"object","desc":"Object injected as the second argument of the complete function in case of an asynchronous query. Default to null."},{"name":"timeout","type":"int","desc":"Maximum wait time in milliseconds in case of an asynchronous query. Default to 300000 (5 minutes)."}],
      "returns": null,
      "available_in": ["workflow","jssp","webapp","typology"],
      "see_also": ["logVerbose","logInfo","logWarning"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "formatDate",
      "group": "Date",
      "url": "https://myrosblog.com/adobe-campaign/reference/formatDate",
      "summary": "Format a date into a string using a Campaign date mask. Opposite of parseTimeStamp.",
      "signature": "formatDate(date: Date, format: string): string",
      "params": [{"name":"date","type":"Date","desc":"The date to format. Often `getCurrentDate()` or `new Date()`."},{"name":"format","type":"string","desc":"A Campaign date mask (see tokens below)."}],
      "returns": [{"type":"string","desc":"The formatted date."}],
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["getCurrentDate"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "getCurrentDate",
      "group": "Date",
      "url": "https://myrosblog.com/adobe-campaign/reference/getCurrentDate",
      "summary": "Return the current server date and time as a JavaScript Date. Use it instead of new Date() for \"now\".",
      "signature": "getCurrentDate(): Date",
      "params": null,
      "returns": [{"type":"Date","desc":"The current date and time on the server, as a JavaScript Date."}],
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["formatDate","parseTimeStamp"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "getOption",
      "group": "Database",
      "url": "https://myrosblog.com/adobe-campaign/reference/getOption",
      "summary": "Helper to read an instance-specific setting from the xtk:option schema, useful for environment variable.",
      "signature": "getOption(name: string, useCache: bool): any",
      "params": [{"name":"name","type":"string","desc":"Internal name (<code>@name</code>) of the <code>xtk:option</code> record"}],
      "returns": {"type":"any","desc":"Value of the option. The return type is defined by the xtk:option.@type value"},
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["sqlSelect","setOption"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "getUUID",
      "group": "Misc",
      "url": "https://myrosblog.com/adobe-campaign/reference/getUUID",
      "summary": "Returns a random universally unique identifier (UUID) as a string.",
      "signature": "getUUID(): string",
      "params": null,
      "returns": [{"type":"string","desc":"A new UUID string, unique on each call."}],
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["instanceVarDir"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "getValue",
      "group": "XML",
      "url": "https://myrosblog.com/adobe-campaign/reference/getValue",
      "summary": "Adobe Campaign's Xpath helpers to get XML values.",
      "signature": "DOMElement.getValue(xpath: string): string\nDOMElement.getNumberValue(xpath: string): number",
      "params": null,
      "returns": null,
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["DOMElement","NL.is"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "instanceName",
      "group": "Application",
      "url": "https://myrosblog.com/adobe-campaign/reference/instanceName",
      "summary": "The name of the current Adobe Campaign instance, as a read-only string.",
      "signature": "application.instanceName: string",
      "params": null,
      "returns": null,
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["instanceVarDir","instanceUploadDir"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "instanceUploadDir",
      "group": "Application",
      "url": "https://myrosblog.com/adobe-campaign/reference/instanceUploadDir",
      "summary": "The absolute path to the instance upload folder, as a read-only string.",
      "signature": "application.instanceUploadDir: string",
      "params": null,
      "returns": null,
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["instanceVarDir","instanceName"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "instanceVarDir",
      "group": "Application",
      "url": "https://myrosblog.com/adobe-campaign/reference/instanceVarDir",
      "summary": "The absolute path to the instance VAR folder, as a read-only string.",
      "signature": "application.instanceVarDir: string",
      "params": null,
      "returns": null,
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["instanceName","instanceUploadDir"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "loadLibrary",
      "group": null,
      "url": "https://myrosblog.com/adobe-campaign/reference/loadLibrary",
      "summary": "Adobe Campaign's import helper. Use it to call methods defined in other JavaScript files.",
      "signature": "loadLibrary(filename [, useCache: true]): void",
      "params": [{"name":"filename","type":"string","desc":"The JavaScript to import from the xtk:javascript table. Use the format 'namespace:name'"},{"name":"useCache","type":"boolean","desc":"Enables the cache. Enabled by default."}],
      "returns": null,
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["queryDef","DOMElement","NL.is"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "logError",
      "group": "Log",
      "url": "https://myrosblog.com/adobe-campaign/reference/logError",
      "summary": "Store and display a message with Error level, and throws an Exception.",
      "signature": "logError(message: any): void",
      "params": [{"name":"message","type":"any","desc":"Variable to debug"}],
      "returns": null,
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["logVerbose","logInfo","logWarning"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "logInfo",
      "group": "Log",
      "url": "https://myrosblog.com/adobe-campaign/reference/logInfo",
      "summary": "Store and display a message with Info level.",
      "signature": "logInfo(message: any): void",
      "params": [{"name":"message","type":"any","desc":"Variable to debug"}],
      "returns": null,
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["logVerbose","logWarning","logError"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "logVerbose",
      "group": "Log",
      "url": "https://myrosblog.com/adobe-campaign/reference/logVerbose",
      "summary": "Store and display a message with Verbose level. Only if the server was started in verbose mode.",
      "signature": "logVerbose(message: any): void",
      "params": [{"name":"message","type":"any","desc":"Variable to debug"}],
      "returns": null,
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["logInfo","logWarning","logError"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "logWarning",
      "group": "Log",
      "url": "https://myrosblog.com/adobe-campaign/reference/logWarning",
      "summary": "Store and display a message with Warning level.",
      "signature": "logWarning(message: any): void",
      "params": [{"name":"message","type":"any","desc":"Variable to debug"}],
      "returns": null,
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["logVerbose","logInfo","logError"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "logonEscalation",
      "group": "Security",
      "url": "https://myrosblog.com/adobe-campaign/reference/logonEscalation",
      "summary": "Change the current operator, usually in a JSSP / web-app session (e.g. webapp), for database access.",
      "signature": "logonEscalation(operator: string): context",
      "params": [{"name":"operator","type":"string","desc":"Internal login of the operator to escalate to, e.g. <code>webapp</code>."}],
      "returns": [{"type":"context","desc":"The previous login context — pass it back to logon() to restore."}],
      "available_in": ["jssp","webapp"],
      "see_also": ["request","response"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "parseTimeStamp",
      "group": "Date",
      "url": "https://myrosblog.com/adobe-campaign/reference/parseTimeStamp",
      "summary": "Parse a Campaign timestamp string into a JavaScript Date, so it can be compared or stored. The inverse of formatDate.",
      "signature": "parseTimeStamp(date: string): Date",
      "params": [{"name":"date","type":"string","desc":"A serialized Campaign timestamp, e.g. a date attribute read from a query."}],
      "returns": [{"type":"Date","desc":"A JavaScript Date."}],
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["formatDate","sqlSelect"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "queryDef",
      "group": "Database",
      "url": "https://myrosblog.com/adobe-campaign/reference/queryDef",
      "summary": "Helper to run a SQL SELECT query with JSON and returns an XML element.",
      "signature": "NLWS.xtkQueryDef.create(queryDef: object).ExecuteQuery(): DOMElement",
      "params": [{"name":"queryDef","type":"object","desc":"Query definition. Based on the queryDef language"}],
      "returns": [{"type":"DOMElement","desc":"Query result. As an DOM object."}],
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["sqlSelect","DOMElement","getOption","NL.XTK.parse"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "request",
      "group": "JSSP",
      "url": "https://myrosblog.com/adobe-campaign/reference/request",
      "summary": "The HttpServletRequest object — read query parameters, body, headers and client info in a JSSP.",
      "signature": "request: HttpServletRequest",
      "params": null,
      "returns": null,
      "available_in": ["jssp","webapp"],
      "see_also": ["response","setContentType","write"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "response",
      "group": "JSSP",
      "url": "https://myrosblog.com/adobe-campaign/reference/response",
      "summary": "The HttpServletResponse object — set the content type, headers, cookies and redirects in a JSSP.",
      "signature": "response: HttpServletResponse",
      "params": null,
      "returns": null,
      "available_in": ["jssp","webapp"],
      "see_also": ["request","setContentType","write"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "route",
      "group": "JSSP",
      "url": "https://myrosblog.com/adobe-campaign/reference/nl-route",
      "summary": "Resolve an Adobe Campaign resource (image, page) to a URL from its key with NL.route.",
      "signature": "NL.route(name: string, mode: string): string",
      "params": [{"name":"name","type":"string","desc":"Resource key, e.g. <code>nms:task.png</code>."},{"name":"mode","type":"string","desc":"Routing mode, e.g. <code>reverse_img</code> for an image URL."}],
      "returns": [{"type":"string","desc":"The resolved URL, e.g. <code>/nms/img/task.png</code>."}],
      "available_in": ["jssp","webapp"],
      "see_also": ["request"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "setContentType",
      "group": "JSSP",
      "url": "https://myrosblog.com/adobe-campaign/reference/setContentType",
      "summary": "Set the HTTP Content-Type header of a JSSP response.",
      "signature": "response.setContentType(type: string): void",
      "params": [{"name":"type","type":"string","desc":"MIME type, e.g. <code>application/json</code> or <code>text/html;charset=utf-8</code>"}],
      "returns": null,
      "available_in": ["jssp","webapp"],
      "see_also": ["response","write"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "setOption",
      "group": "Database",
      "url": "https://myrosblog.com/adobe-campaign/reference/setOption",
      "summary": "Helper to write an instance-specific setting in the native xtk:option schema, useful for environment variable.",
      "signature": "setOption(name: string, value: any, description: string): void",
      "params": [{"name":"name","type":"string","desc":"Internal name (<code>@name</code>) of the <code>xtk:option</code>"},{"name":"value","type":"number|string|date","desc":"Value (<code>@longValue|@stringValue|@timeStampValue</code>) of the <code>xtk:option</code> record"}],
      "returns": null,
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["getOption","sqlSelect"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "sqlExec",
      "group": "Database",
      "url": "https://myrosblog.com/adobe-campaign/reference/sqlExec",
      "summary": "Run a SQL query for advanced needs. Prefer using workflow activities (\"Update Data\").",
      "signature": "sqlExec(query:string, ...values:any[]): number",
      "params": [{"name":"query","type":"string","desc":"SQL statement with placeholders."},{"name":"...values","type":"any","desc":"Values of the placeholders, in order"}],
      "returns": [{"type":"number","desc":"Number of rows affected (INSERT/UPDATE/DELETE). 0 for DDL."}],
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["sqlSelect"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "sqlSelect",
      "group": "Database",
      "url": "https://myrosblog.com/adobe-campaign/reference/sqlSelect",
      "summary": "Run a raw SQL SELECT on the native PostgreSQL tables and catalogs. Prefer queryDef for Adobe schemas.",
      "signature": "sqlSelect(format: string, query: string, dataSource?: string, ...values: any[]): object",
      "params": [{"name":"format","type":"string","desc":"Result shape: a root name then one typed column per SQL field, as `name:type` or `@name:type` (`@` = XML attribute, otherwise element). Types such as `long`, `string`, `datetime`, `timestamp`, `memo`."},{"name":"query","type":"string","desc":"SQL statement with placeholders."},{"name":"dataSource","type":"string","desc":"Datasource name. Empty string or omitted uses the default database."},{"name":"...values","type":"any","desc":"Values of the placeholders, in order."}],
      "returns": {"type":"object","desc":"An E4X XML collection — iterate rows with `for each`, not as an array."},
      "available_in": ["workflow","jssp","webapp","typology","delivery"],
      "see_also": ["sqlExec","queryDef"],
      "last_modified_at": "2026-10-19"
    },
    {
      "name": "write",
      "group": "JSSP",
      "url": "https://myrosblog.com/adobe-campaign/reference/document-write",
      "summary": "Append a string to the JSSP response body — the server-side equivalent of print.",
      "signature": "document.write(content: string): void",
      "params": [{"name":"content","type":"string","desc":"String appended to the response body."}],
      "returns": null,
      "available_in": ["jssp","webapp"],
      "see_also": ["response","setContentType"],
      "last_modified_at": "2026-10-19"
    }
  ]
}
