> For the complete documentation index, see [llms.txt](https://docs.thingsup.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thingsup.io/widgets/data-text-widget.md).

# Data Text Widget

**General Setting**

User can change following things in Data Text widget:

* Name for widget which will be used data reference. For Example, if widget name is 'Data Text', then data of widget is referenced as Data Text.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Data Text Widget](/files/oZaK1IxUjosdXqrcwYJx)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Key - key parameter of JSON Object which will used to get data.
* Data Color&#x20;
* Unit - Unit for Data
* Decimal units- Number of decimal units

![Configure Data Text Widget](/files/nZ1jKYO2qW5RGuVrRm3z)

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to show data on Data Text widget user need to send data in given format on given MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON object will be as below.

```
// Example 

{"dataKey":10.2}
OR
{"dataKey":"hi"}
OR
{"dataKey":"100"}

// 'dataKey' is declared in widget form.
```

![Configure Data Text Widget](/files/QEGMFak1fy8Zfs3kY8n0)

**Using Action**

Here, to show data on Data Text Widget, output of the action should contain key-value pair with 'dataKey' key. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Data Text Widget](/files/G29jVzWW9RX0ftnUL8wE)

#### Event Handling

Data Text widget does not support any event.

#### Example

If we configure Data Text Widget as below:

1. key - dataKey
2. Unit - %
3. Decimal points - 2

and set source type for widget as MQTT and topic configured is 'data'. And if we publish following JSON Object over 'data' topic then Data Text Widget will look as shown in image.

```
// Data over configured MQTT Topic

{ 
    "dataKey":89.32
}
```

![](/files/9T2HoKIOZC841OOdskBB)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.thingsup.io/widgets/data-text-widget.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
