---
title: DoubleData Widget
description: "**Purpose:** The `DoubleData` widget is used to display two related, real-time values from a nested data structure. It's perfect for showing a primary and secondary metric from a single device or system, such as the RPM and vibration of a motor. Table Of…"
url: "https://twinnoverse.com/docs/doubledata-widget/"
updated: "2025-10-14"
category: Digital twin / Digital Twin Widget System / Digital Twin Widget Library Reference
---

# DoubleData Widget

**Purpose:** The `DoubleData` widget is used to display two related, real-time values from a nested data structure. It's perfect for showing a primary and secondary metric from a single device or system, such as the RPM and vibration of a motor.

    Table Of Contents

- [Anatomy](#anatomy)
- [Configuration Settings](#configuration-settings)
- [Data Schema](#data-schema)
- [Alert Actions](#alert-actions)
- [Use Cases](#use-cases)

---

## Anatomy

- **Primary Title & Value:** The top half of the widget, displaying the main data point.
- **Secondary Title & Value:** The bottom half, displaying a supplementary data point.
- **Expand Button:** If a "Large View" is configured, this button appears to open a more detailed view.

---

## Configuration Settings

When adding a `DoubleData` widget in the Asset Editor, you will be presented with the following settings.

| Group | Setting | UI Control | Description |
| --- | --- | --- | --- |
| **Datasource** | **Datasource** | Dropdown | The datasource to stream data from. |
|  | **Data Key** | Text Input | The top-level key in your JSON payload that contains the nested object with your two values. |
| **Primary Value** | **Title** | Text Input | The display name for the primary (top) value. |
|  | **Sub-Key** | Text Input | The key inside the nested object that corresponds to the primary value. |
| **Secondary Value** | **Title** | Text Input | The display name for the secondary (bottom) value. |
|  | **Sub-Key** | Text Input | The key inside the nested object that corresponds to the secondary value. |
| **Alerts** | *(Full alert settings are configured here)* | - | See [Guide: Creating Powerful Alerts](https://twinnoverse.com/docs/creating-powerful-alerts/) for details. The alert condition is checked against the **Primary Value**. |
| **Floating Icon** | *(Icon settings are configured here)* | - | Configures an icon to appear in the 3D scene when an alert is active. |

---

## Data Schema

The `DoubleData` widget expects the payload to contain a key (matching the widget's **Data Key**) that points to a nested JSON object. The keys within this nested object must match the **Primary Sub-Key** and **Secondary Sub-Key** from the settings.

**Example:**

- Data Key: `"motor_stats"`
- Primary Sub-Key: `"rpm"`
- Secondary Sub-Key: `"vibration"`

**Expected JSON Payload:**

```
{
  "motor_stats": {
    "rpm": 1500,
    "vibration": 0.75
  }
}
```

---

## Alert Actions

When an alert condition is met (based on the primary value), the following actions can be triggered:

- **`ChangeWidgetColor`:** The color of the **Primary Value** text will change to red.
- **`ChangeMaterialColor`:** Can trigger an action to change the color of the parent 3D asset.

---

## Use Cases

- Displaying the RPM and vibration of an engine.
- Showing the input and output pressure of a pump.
- Monitoring the voltage and current of a power supply.
