Skip to main content
Context is a global object that exposes transaction data to your Custom activity script, lets you send HTTP requests, log custom messages, and retrieve tenant secrets.

Properties

Assigning a value to ErrorMessage interrupts the transaction.

Deprecated properties

The InputData and OutputData properties are deprecated. Use Transaction.Documents instead.

Methods

CreateMultipartFormDataRequest

Returns a MultipartFormDataRequest object for sending data as a form containing strings and files (multipart/form-data).

CreateHttpRequest

Returns an HttpRequest object for sending a string, file, source image, or a simple URL-form-encoded form. This form cannot contain files.

LogMessage

Writes a custom message to the Transaction Event Log.

GetSecret

Returns the value of a tenant environment variable of type secret. Use this method to pass tokens to third-party services without hardcoding them in your script.
To list secrets available in your tenant, start typing Context.GetSecret( in the script editor and press Ctrl + Space while your cursor is inside the parentheses.
If the variable name contains reserved characters (" or ,), escape them with a backslash in the method call. Only users with the Tenant Administrator role can create, edit, or delete environment variables. For details, see Manage environment variables.