> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Context

> The Context global object — properties and methods for accessing transaction data, sending HTTP requests, and retrieving secrets.

`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

| Name             | Type                                                                                     | Access     | Description                                                                                  |
| :--------------- | :--------------------------------------------------------------------------------------- | :--------- | :------------------------------------------------------------------------------------------- |
| **Transaction**  | [Transaction](/vantage/documentation/skill-designer/process/custom-activity/transaction) | Read-only  | The `Transaction` object, providing access to the current transaction and all its documents. |
| **ErrorMessage** | string                                                                                   | Read-write | Custom error message. The text appears in the Transaction Event Log in Skill Monitor.        |

<Warning>
  Assigning a value to `ErrorMessage` interrupts the transaction.
</Warning>

### Deprecated properties

<Warning>
  The `InputData` and `OutputData` properties are deprecated. Use [`Transaction.Documents`](/vantage/documentation/skill-designer/process/custom-activity/transaction#documents) instead.
</Warning>

| Name           | Type                                                                                                         | Access    | Description                                                |
| :------------- | :----------------------------------------------------------------------------------------------------------- | :-------- | :--------------------------------------------------------- |
| **InputData**  | [Transaction.Documents](/vantage/documentation/skill-designer/process/custom-activity/transaction#documents) | Read-only | Document data during skill execution.                      |
| **OutputData** | [Transaction.Documents](/vantage/documentation/skill-designer/process/custom-activity/transaction#documents) | Read-only | Modified document data. Not available for External Export. |

## Methods

### CreateMultipartFormDataRequest

```javascript theme={null}
MultipartFormDataRequest CreateMultipartFormDataRequest();
```

Returns a [`MultipartFormDataRequest`](/vantage/documentation/skill-designer/process/custom-activity/multi-part-form-data-request) object for sending data as a form containing strings and files (`multipart/form-data`).

### CreateHttpRequest

```javascript theme={null}
HttpRequest CreateHttpRequest();
```

Returns an [`HttpRequest`](/vantage/documentation/skill-designer/process/custom-activity/http-request) object for sending a string, file, source image, or a simple URL-form-encoded form. This form cannot contain files.

### LogMessage

```javascript theme={null}
void LogMessage(string msg);
```

Writes a custom message to the Transaction Event Log.

### GetSecret

```javascript theme={null}
string GetSecret(string secretName);
```

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.

<Tip>
  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.
</Tip>

<Note>
  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](/vantage/documentation/tenant-admin/tenant-management/manage-environment-variables).
</Note>

## Related topics

<CardGroup cols={3}>
  <Card title="Custom activity" icon="code" href="/vantage/documentation/skill-designer/process/custom-activity/custom-activity">
    Extend skills with scripted logic and third-party integrations.
  </Card>

  <Card title="Object model" icon="diagram-project" href="/vantage/documentation/skill-designer/process/custom-activity/object-model">
    Full JavaScript object reference for Custom activity scripts.
  </Card>

  <Card title="Transaction" icon="exchange" href="/vantage/documentation/skill-designer/process/custom-activity/transaction">
    The current transaction and access to all of its documents.
  </Card>

  <Card title="Manage environment variables" icon="gear" href="/vantage/documentation/tenant-admin/tenant-management/manage-environment-variables">
    Store tenant-level secrets passed to Custom and Output activities.
  </Card>

  <Card title="Sample scripts" icon="file-code" href="/vantage/documentation/skill-designer/process/custom-activity/sample-scripts">
    JavaScript samples for common Custom activity scenarios.
  </Card>
</CardGroup>
