---
title: Create and Import Models
slug: litmusedge-v1/product-features/digital-twins/create-and-import-models
description: Learn how to create and import digital twins models. 
docTags: 
createdAt: 2022-09-08T19:10:53.000Z
---

:::hint{type="info"}
**Notes**:&#x20;

- The Digital Twins feature is available for Litmus Edge version 3.3.1 and later.&#x20;
- To access the Digital Twins feature, you need a Scale or Growth Litmus license.&#x20;
:::

You can create Digital Twins models by navigating to **Digital Twins** > **Models**.&#x20;

See [Use Digital Twins to Contextualize Data](docId\:QtojjkM-sj2wJ4jlQV_ku) to review how to leverage Digital Twins.&#x20;

# Step 1: Create Model

You have two options for creating the model. You can create a new model or import a model as a JSON file.&#x20;

## Create a  New Model

**To create a new model:**

1. Navigate to **Digital Twins**.&#x20;
   The *Models&#x20;*&#x70;ane appears.&#x20;
2. From the *Models&#x20;*&#x70;ane, click the **Create a model&#x20;**&#x74;ile.&#x20;
   The *Create a Model* dialog box appears.

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/RgVgMbkVf98fnibVlKx5M_createmodel.png" size="80" width="1266" height="482" caption="The Create a Model tile" position="center" darkWidth="1266" darkHeight="482" showCaption="true"}
3. Click the **Type** drop-down list and select a model type.
4. Enter the name of the model in the **Name** field.
5. (Optional) Enter a short description of the model in the **Description** field.
6. Click **Add**.****
   A new model tile appears in the *Models&#x20;*&#x70;ane.

## Import an Existing Model

You can import a model as a JSON file.

To import an existing model, click th&#x65;**&#x20;Import Model** icon, select the `<model name>.json` file, and click **Open**.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/LAj9ItVAwnDjSPV0mYRoF_image.png" size="80" width="1920" height="482" caption="Import Model icon" position="center" darkWidth="1920" darkHeight="482" showCaption="true"}

# Model Versions

:::hint{type="info"}
**Note**: This feature is available for Litmus Edge version 3.11.0 and later.&#x20;
:::

When you create a model, the model version starts at v.0. When you make changes to the model, the version number is updated.

For Litmus Edge version 3.11.0 and later, the version number is displayed in the model tile.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/jPBv5O4fpRB8jFV_f7V7l_image.png" size="50" width="335" height="210" position="center" caption="Model version number" darkWidth="335" darkHeight="210" showCaption="true"}

For Litmus Edge version 3.11.1 and later, the version number is also displayed in the model and instance configuration.&#x20;

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/nmQikKc41s_wHfE2Fee4n_image.png)

## Implement Model Updates to Instances

If there are changes to the model that need to be implemented in associated instances, click **Upgrade Instances**.&#x20;

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/Rgs0kvMtFSrm_123zkbHa_image.png)

Then, select the instances to upgrade and click **Upgrade**.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/5Os84oYFEY-0PBcVVZtf1_image.png" size="70" width="557" height="388" position="center" caption="Model Changed dialog" darkWidth="557" darkHeight="388" showCaption="true"}

# Step 2: Configure Model

After creating the model, you can configure it appropriately for instances.&#x20;

:::hint{type="warning"}
**Important**:&#x20;

- For Litmus Edge version 3.5.6 and earlier, no changes are allowed to a model after creating an instance for the model.&#x20;
- For Litmus Edge version 3.11.0 and later, you have the option to update models with instances and select which instances to update as well.&#x20;
:::

Click the **Model tile** (grid view) or **Model name** (table view) to view the model details.&#x20;

## Model Image

Click th&#x65;**&#x20;Upload image** icon to select an image for the model. The image will display for the model tile on the *Models* pane. Supported file types include: .jpeg and .png&#x20;

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/XYH_aNPgthh_1gBbAvfWB_image.png)

## Static Attributes

Manage the metadata for the model from the *Static Attributes* tab.&#x20;

:::hint{type="info"}
**Notes**:&#x20;

- For Litmus Edge versions 3.3.1 to 3.5.6, there is a limit of 100 static attributes. For versions 3.11.0 and later, the limit is 2000.&#x20;
- The ability to export and import dynamic attributes is available for Litmus Edge version 3.11.0 and later.&#x20;
:::

### Manually Add Static Attributes

**To add static attributes:**

1. Click the **Model tile** (grid view) or **Model name** (table view) to open the model details.
2. From the *Static Attributes* tab, click th&#x65;**&#x20;Add item** icon.

   ![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/hmxwhOto77_RLH6G0ehTX_addstaticattribute.png)
3. In the **Attribute Name** field, either select an item from the drop-down list or enter a custom attribute name.

   ![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/tQMBusfb2ujK3UBOENwm1_static-attribute-drop-down.png)
4. In the **Attribute Value** field, enter a value for the model.&#x20;
5. When done adding attributes, click **Save Model**.&#x20;
   For Litmus Edge versions 3.5.6 and earlier, save individual attributes by clicking the **Save&#x20;**&#x69;con in each attribute row.&#x20;

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/ZVDui9L4AqeosWBCYfX4q_image.png)

If you need to filter existing attributes, you can use the search field.&#x20;

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/yaXD00mMBNAGDI71qzeXo_image.png)

### Import Static Attributes

To import static attributes (Litmus Edge version 3.11.0 and later), create a CSV file with the following headers.&#x20;

**Required Headers**

- ModelName
- Key
- Value

**Optional Headers**

- InstanceName

After creating the file, click the model tile, navigate to **Static Attributes**, and click the **Import Attributes** icon.&#x20;

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/u5VBm49td95Lx1Ir7YBnV_image.png)

### Export Static Attributes

To export a CSV file of existing static attributes (Litmus Edge version 3.11.0 and later), click the **Export Attributes** icon.&#x20;

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/Ev1Zj7-_wQW-jnE4BTwmq_image.png)

## Transformations

Use the *Transformation&#x20;*&#x74;ab to transform the data collected in instances by converting raw JSON data to a desired format by defining the JSON-based schema.&#x20;

You can define schema IDs, which can be used to manipulate the payload and define a structure for the payload as the model inherits data.&#x20;

See [Use Digital Twins to Contextualize Data](docId\:QtojjkM-sj2wJ4jlQV_ku) to review how to format transformations.&#x20;

:::hint{type="info"}
**Note**: If you update a transformation and remove all elements from the schema, the entire NATS message will be included in any dynamic attribute that has the transformation selected for the *Schema ID*.
:::

### Arrays

As of Litmus Edge version 3.11.3, you can configure arrays in transformations.&#x20;

For example:

```json
{
  "key": [
    "$timestamp",
    "$value",
    "$metadata",
    {
      "key2": "$timestamp",
      "key3": "$value",
      "key4": "$metadata"
    }
  ],
  "key5 new": "$timestamp"
}
```

### Configure Transformations

**To add a transformation schema:**

1. Click the **Model tile** (grid view) or **Model name** (table view) to open the model details.&#x20;
2. Click the **Transformation&#x20;**&#x74;ab.&#x20;
3. Click the **Add a Schema** icon.
   The *Add&#x20;*&#x64;ialog box appears.

   ![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/Duc_t-8xRuTXa1rtqt-vb_transformation1.png)
4. Enter a name for the schema.&#x20;
5. In the code window, copy and paste the JSON-based schema.&#x20;
6. Click **Add**.&#x20;
7. When done adding attributes, click **Save Model**.&#x20;
   For Litmus Edge versions 3.5.6 and earlier, transformations are automatically saved.&#x20;

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/HS0Azvt0qrTpE9p_Pbgg5_image.png)

To edit or delete a schema, click the **Action menu** for the schema and select an option.&#x20;

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/AZjj0404qT6twuQpILYOO_image.png)

## Dynamic Attributes

Manage variable data in the model from the *Dynamic Attributes* tab. You have the option of adding a schema ID, which can be used to map dynamic attributes one-to-one for data transformation.&#x20;

:::hint{type="info"}
**Notes**:&#x20;

- For Litmus Edge versions 3.3.1 to 3.5.6, there is a limit of 100 dynamic attributes. For versions 3.11.0 and later, the limit is 2000.&#x20;
- The ability to export and import dynamic attributes is available for Litmus Edge version 3.11.0 and later.&#x20;
:::

### Manually Add Dynamic Attributes

**To add a dynamic attribute:**

1. Click the **Add item** icon.

   ![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/dOe_yUAtUjALAOwFJ_zLz_dynamic-attribute-add.png)
2. In the **Name&#x20;**&#x66;ield, enter a name for the attribute.&#x20;
3. (Optional) Enter values for **Unit&#x20;**&#x61;nd **DataType**.&#x20;
   For Litmus Edge version 3.11.0 and later, you have the option of selecting the data type from the drop-down menu.&#x20;
4. (Optional) If you've created data transformation schemas, select one from the **SchemaID&#x20;**&#x66;ield.&#x20;
5. When done adding attributes, click **Save Model**.&#x20;
   For Litmus Edge versions 3.5.6 and earlier, save individual attributes by clicking the **Save&#x20;**&#x69;con in each attribute row.&#x20;

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/xUKT12R7183L76GawmVZ1_image.png)

If you need to filter existing attributes, you can use the search field.&#x20;

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/pF_P7GosQRrvuPoQpghUv_image.png)

### Import Dynamic Attributes

To import dynamic attributes (Litmus Edge version 3.11.0 and later), create a CSV file with the following headers.&#x20;

**Required Headers**

- ModelName
- SchemaID

**&#x20;Optional Headers**

- InstanceName
- Topic
- Name
- Unit
- DataType

After creating the file, click the model tile, navigate to **Dynamic Attributes**, and click the **Import Attributes** icon.&#x20;

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/wg0bX9HLb_U_u9cZ4EJVL_image.png)

### Export Dynamic Attributes

To export a CSV file of existing dynamic attributes (Litmus Edge version 3.11.0 and later), click the **Export Attributes** icon.&#x20;

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/cnZJfzt9R1E4n04FfnEWr_image.png)

## Hierarchy

Use the *Hierarchy&#x20;*&#x74;ab to create a custom data structure for the model.&#x20;

:::hint{type="info"}
**Notes**:&#x20;

- The **Save&#x20;**&#x62;utton is available for Litmus Edge version 3.5.2 and later.&#x20;
- The ability to rename nodes/items and import/export hierarchies is available for Litmus Edge version 3.11.0 and later.&#x20;
- Clicking the **Save Model** button will increment the version number, even if no changes are made.
:::

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/N1D1TJzfn2wYtmUmHMpRf_image.png)

To create a category for the hierarchy, click the **Action menu** icon for *root&#x20;*&#x61;nd select **Add Node**.&#x20;

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/iQBvtNvgJXZxX39mnxhQt_image.png)

To add attributes to the hierarchy, do one of the following:&#x20;

- Drag and drop attributes from the left-hand list to the canvas under the appropriate category.&#x20;
- Click the **Action menu** for a category and select **Add item to Node**. Then, select the attribute to add.

When done configuring the hierarchy, click **Save Model**. For Litmus Edge versions 3.5.6 and earlier, click the **Save&#x20;**&#x69;con. &#x20;

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/HGQDfpia41OpwEJzcxXL7_image.png)

### Rename Nodes

To rename nodes and attributes added to nodes (for Litmus Edge version 3.11.0 and later), click the **Rename Node** and **Rename Item&#x20;**&#x69;cons.&#x20;

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/tpgNljAuojmbN0pbhqgTg_image.png)

### Import Hierarchies

To import a CSV file of a hierarchy (Litmus Edge version 3.11.0 and later), create a CSV file with the following headers:

- ID
- ModelID
- Position: Enter the position of the attribute in the hierarchy.&#x20;
- ParentID: If the attribute is under a node/category, enter the ParentID of the node. To get the ParentID, create a new node, export the hierarchy, and then refer to the **ParentID&#x20;**&#x63;olumn.&#x20;
- Name: The name of the attribute.&#x20;
- IsFolder: If it is an attribute, the value is **FALSE**. If it is a node, the value is **TRUE**.&#x20;
- AttributeID
- AttributeType

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/a0nSOR2U2xjYMhcO482j-_image.png)

### Export Hierarchies

To export a CSV file of an existing hierarchy (Litmus Edge version 3.11.0 and later), click the **Export hierarchy&#x20;**&#x69;con.&#x20;

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/BoSkzIsXE_G49v-2eWx2m_image.png)



