---
title: Troubleshooting JSONata transform error: "Cannot convert undefined or null to object"
slug: troubleshooting-jsonata-transform-error-cannot-convert-undefined-or-null-to-object
docTags: 
createdAt: 2026-09-24T11:22:15.356Z
---

**Applies to:** Turbine Cloud **26.4.1** (JSONata **2.2.1**)

***

## Overview

A playbook or component may fail in a **Transform Data** action with this JSONata error:

```text
Cannot convert undefined or null to object
```

This usually means a transform expression is referencing a field or property that is not present in the input data for that run. **Turbine Cloud 26.4.1** uses **JSONata 2.2.1**, which evaluates these cases more strictly than earlier JSONata versions.

In earlier releases, an invalid property path could resolve to empty or undefined output without failing the transform block. With **JSONata 2.2.1**, expressions that pass `undefined` or `null` into object functions (such as `$sift()`) are more likely to fail the block and stop the playbook run.

This is **not** a universal change to Transform output structure. In most reported cases, the expression itself references an invalid path that previously may not have caused the block to fail.

***

## Symptoms

You may see:

- A playbook or component run fails in a Transform action (commonly seen on **26.4.1** with JSONata **2.2.1**)
- Failure occurs in a **Transform Data / JSONata** action
- Error message:

```text
Cannot convert undefined or null to object
```

The error may also include:

- the transform block name (for example, `data`)
- a position number in the expression

***

## What to check

1. Confirm your tenant is on **26.4.1** (JSONata **2.2.1**)
2. Open the failed playbook run and identify:
   - the failing action
   - the transform block name
   - the exact error message
3. Review the transform expression against the actual input payload from the failed run
4. Look for references to properties or paths that do not exist in the input JSON

If the expression assumes a nested object exists, but the payload contains `null` or a missing field, the transform may fail under JSONata **2.2.1**.

***

## If your error looks different

The same error message can have different root causes. Not every `Cannot convert undefined or null to object` failure has the same fix.

If your failure does not match a known pattern below, contact Swimlane Support and provide:

- tenant URL / region
- Turbine version (**26.4.1**)
- playbook or component name
- failing action and transform block name
- run ID and job ID
- screenshot or export of the failing transform expression
- time the failure started

Support will review the expression against the actual run input and advise on the correct fix.

***

## Known example: email ingestion (Process Graph API Email)

We have also seen this error in **email ingestion** workflows using the component below. Include this section only if your failure matches this pattern.

### Component

**Process Graph API Email**

### Failing location

| Item            | Value                   |
| --------------- | ----------------------- |
| Action          | Parse Attachment Fields |
| Transform block | `data`                  |

### Cause

The transform expression may reference an invalid property path such as:

```jsonata
$sift(loops.Foreach_Attachment.value.attacment.info, function($v, $k) { $k != "contentBytes"})
```

The attachment data is structured as:

```json
{
  "info": { ... },
  "data": [ ... ]
}
```

Because `attacment` is not a valid property, the expression fails under JSONata **2.2.1**.

### Resolution

Update the expression in block `data` to:

```jsonata
$sift(loops.Foreach_Attachment.value.info, function($v, $k) { $k != "contentBytes"})
```

### Steps

1. Open the **Process Graph API Email** component
2. Go to **Parse Attachment Fields**
3. Edit transform block **data**
4. Update the expression as shown above
5. Save the component
6. Re-run the workflow and confirm the playbook completes successfully

***

## Short summary

Some Transform actions may fail with **"Cannot convert undefined or null to object"** when **JSONata 2.2.1** evaluates an invalid property path more strictly than earlier versions. Review the failing expression against the run input payload. One known example affects email ingestion via **Process Graph API Email** → **Parse Attachment Fields** → block `data`. Contact Support if your case does not match or you need help validating the fix.

***

## Need more help?

Open a support ticket with your run details and reference this article. Our team can help confirm whether your case matches a known pattern or needs further investigation.
