---
title: Jsonata
slug: connectors/jsonata
docTags: 
createdAt: 2026-06-09T16:29:33.889Z
---

The JSONata connector enables the transformation and querying of JSON data using JSONata expressions within the Swimlane platform.

Jsonata is a lightweight query and transformation language for json data, enabling the extraction and manipulation of data from complex structures. this connector allows swimlane turbine users to apply jsonata expressions directly within their security playbooks, transforming and querying data with ease. by integrating jsonata, users can enhance their automation workflows, reduce manual data processing, and ensure consistent data formatting across different systems. the connector's 'evaluate expression' action simplifies complex data operations, making it a powerful tool for security analysts who need to handle diverse data sets quickly and accurately.

## Setup

The JSONata connector comes with one action, `Evaluate Expression`.
There are two inputs:

1. The expression to apply to the JSON data.
2. An empty `object` input to begin adding sub-properties to for adding data to query.

The entry point for the data is the `object` input. You may create sub-properties of the correct type
and map any playbook inputs, event properties, or upstream action outputs to them.

Example:

You have a JSONata action with two upstream actions, `action 1` and `action 2`. When configuring the JSONata action,
you can add two sub-properties to the `object` input to which the output of `action 1` and `action 2` can be mapped.
The data you have to query will then become:

```json
{
  "object": {
    "property1": {"<action 1 data>"},
    "property2": {"<action 2 data>"}
  }
}
```

This allows you to combine data into one object to query and transform.
So if action1 and action2 results are arrays, you can do something simple like:

expression = `append(object.property1, object.property2)` which would return a single array of the two added together.

## Output

There is one output property for each type that the output could be:

- String
- Number
- Boolean
- object
- Numeric Array
- String Array
- Object Array

Only 1 output property will be returned for a single run of the action. The output property that will be populated and
returned is determined by the type of the return value of the JSONata expression.

### Examples

| JSONata return value    | Output property containing result |
| ----------------------- | --------------------------------- |
| "a string"              | String                            |
| 123                     | Number                            |
| true                    | Boolean                           |
| \[1, 2, 3]              | Numeric Array                     |
| \["a", "b", "c"]        | String Array                      |
| \[\{"a": 1}, \{"b": 2}] | Object Array                      |
| "123"                   | String                            |
| "true"                  | String                            |
| 12.3                    | Number                            |

## Additional Documentation

- [Jsonata Connector Documentation](https://docs.swimlane.com/connectors/jsonata)
- [Jsonata API Documentation](https://docs.jsonata.org/)

# Actions

## Evaluate Expression

Transform and query data using a JSONata expression, with 'expression' as a required input.

### Input

| **Argument Name** | **Type** | **Required** | **Description**                     |
| ----------------- | -------- | ------------ | ----------------------------------- |
| `expression`      | string   | Required     | The JSONata expression to execute.  |
| `object`          | object   | Optional     | Object input to transform or query. |

### Input Example

`{"object":{"Swimlane":"SOAR"}}`

### Output

| **Parameter** | **Type** | **Description**                  |
| ------------- | -------- | -------------------------------- |
| `string`      | string   | String response output.          |
| `number`      | number   | Number response output.          |
| `boolean`     | boolean  | Boolean response output.         |
| `object`      | object   | Object response output.          |
| `arrayNumber` | array    | Array with numeric items output. |
| `arrayString` | array    | Array with string items output.  |
| `arrayObject` | array    | Array with object items output.  |

### Output Example

`{"string":"string","number":123,"boolean":true,"object":{},"arrayNumber":[],"arrayString":[],"arrayObject":[]}`

# Response Headers

| **Header**   | **Description**                                       | **Example**                   |
| ------------ | ----------------------------------------------------- | ----------------------------- |
| Content-Type | The media type of the resource                        | application/json              |
| Date         | The date and time at which the message was originated | Thu, 01 Jan 2024 00:00:00 GMT |
