---
title: Configure transformations
slug: litmusedge/product-features/digital-twins/configure-transformations
docTags: 
createdAt: 2026-08-13T20:45:12.460Z
---

A transformation converts the raw JSON data on a topic into a format that northbound systems can consume. You define a transformation as a schema in a Litmus Edge (LE) model, apply it to a dynamic attribute, and the transformed result replaces the raw data in the instance payload.

This topic shows you how to add a transformation schema, test it, and apply it to a dynamic attribute. For the rest of the model, see [Create and configure a model](docId\:zPaDX1lMmE0F44V7r6v6Q).

:::hint{type="info"}
**Note:** Also see [Digital Twins](docId\:xlj3gvOZyg_52Ue4pB5u7) for overview and background information.
:::

## Before you begin

Before you configure a transformation, make sure you have:

- A model with at least one dynamic attribute.
- Sample data from the topic that feeds the attribute so you can test the schema in the playground.

## JSON or JSONata

| **Schema type** | **What it does**                                                  | **Use it for**                                       |
| --------------- | ----------------------------------------------------------------- | ---------------------------------------------------- |
| JSON            | Filters the payload to a specific set of key-value pairs          | Stripping unwanted fields from a data source         |
| JSONata         | Applies conditional logic, computed values, and dynamic filtering | Alerts, computed outputs, or reformatting timestamps |

JSONata schemas use the [JSONata](https://docs.jsonata.org/overview.html) query language.

## Add a transformation schema

**To define a schema in the model:**

1. Click the **Transformation** tab, then click **Add a Schema**.

::Image[]{src="https://app.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/eLiUKNvqAqvwrKOtQ3HDF_image.png" size="80" alt="Transformation tab with the Add a Schema button" caption="The Transformation tab" isUploading="false" width="1367" height="533" darkWidth="1367" darkHeight="533" position="flex-start" showCaption="true" indent="2"}

2. Enter a name for the schema.
3. From the **Schema Type** drop-down menu, select **JSON** or **JSONata**.

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/clHNlahGoqN3B3Y4h_8MJ_image.png" size="80" caption="Schema name and type" isUploading="false" width="1344" height="645" darkWidth="1344" darkHeight="645" position="flex-start" alt="New schema dialog with the Name field and Schema Type list" showCaption="true" indent="2"}

4. In the code window, paste the JSON or JSONata schema.
5. Optionally, select system variables from the code drawer to insert them into the schema. See [System variables](docId\:tbKP-rLU3oCBdJCnjy4lq).

## Test the schema in the playground

A schema that returns the wrong shape reaches every instance payload built from the model. Test it in the playground before you apply it to an attribute.

**To test the schema:**

1. In the playground, enter sample data from the topic that feeds the attribute.
   The playground displays the transformed output.
2. Compare the transformed output with the output you expect.
3. Adjust the schema until the output matches.
4. Click **Add**.
   The schema appears in the *Transformation* tab.

::Image[]{src="https://app.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/H2kgVlG9Be7fgHSNzExg4_image.png" size="80" alt="Schema playground showing sample input and the transformed output" caption="The schema playground" isUploading="false" width="1324" height="787" darkWidth="1324" darkHeight="787" position="flex-start" showCaption="true" indent="2"}

## Apply the schema to a dynamic attribute

A schema takes effect only on the attributes that reference it. You can apply the same schema to more than one dynamic attribute.

**To apply the schema:**

1. Click the **Dynamic Attributes** tab.
2. Select the dynamic attribute you want to transform.
3. In the **SchemaID** field, select the schema.
4. Click **Save Model**.

::Image[]{src="https://app.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/9dPM_X8SKkeSuSmH8SqlF_image.png" size="80" alt="Dynamic Attributes tab with the SchemaID field" caption="Applying a schema to a dynamic attribute" isUploading="false" width="1418" height="464" darkWidth="1418" darkHeight="464" position="flex-start" showCaption="true" indent="2"}

To edit or delete a schema, click the **Action menu** for the schema in the **Transformation** tab and select **Edit** or **Remove**.

## System variables

Use system variables to add model and instance context to a transformed payload. Select them from the code drawer in the schema editor.

| **Variable**              | **Inserts**                                            |
| ------------------------- | ------------------------------------------------------ |
| `{EDGE_DT_SYSTEM_TIME}`   | The device system time when the payload is published   |
| `{EDGE_DT_MODEL_VERSION}` | The version of the model the instance was created from |
| `{EDGE_DT_MODEL_NAME}`    | The name of the model the instance was created from    |
| `{EDGE_DT_MODEL_ID}`      | The unique identifier of the model                     |
| `{EDGE_DT_INSTANCE_NAME}` | The name of the instance                               |
| `{EDGE_DT_INSTANCE_ID}`   | The unique identifier of the instance                  |

## Verify the transformation works

:::hint{type="info"}
**Note:** An instance runs against the model version it was created from. Click **Upgrade Instances** on the model to apply a new or changed schema to an existing instance.
:::

**To confirm the transformation is applied:**

1. Navigate to **Digital Twins** > **Instances**.
2. Select an instance created from the model.
3. Click the **Data Access** tab.
4. Subscribe to the instance topic.
   The *Data Access* tab displays the assembled payload.
5. Confirm that the dynamic attribute shows the transformed shape rather than the raw data.

## Related topics

- [Digital Twins](docId\:xlj3gvOZyg_52Ue4pB5u7)
- [Create and configure a model](docId\:zPaDX1lMmE0F44V7r6v6Q)
- [Configure parameters](docId\:TSNcJWVOs5H4bXMoUjIcg)
- [Add an instance](docId\:jzOth4T0hCrTRauUSdRyK)
- [Model and instance actions](docId\:HK0IDxlg7ZCoetaJWcoBO)
