# Data Tile Widget

**General Setting**

User can change following things in Data Tile widget:

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

![Configure Data Tile Widget](https://365492316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7aTljSjWsfbXZ_OP_9%2Fuploads%2Fhsfpsep3lFixundvKWEy%2FdataTileGeneral.png?alt=media\&token=a0faea00-8fa8-47fc-a45f-2d21748e39d8)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Key - key parameter of JSON Object which will define data of Data Tile Widget.
* Data Color&#x20;
* Unit Color&#x20;
* Unit - If any unit need to be given. For example, '%' for battery data.
* Decimal units - Number of decimal points in required in data

![Configure Data Tile Widget](https://365492316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7aTljSjWsfbXZ_OP_9%2Fuploads%2FX36294MoM0hNDyoUa3xQ%2FdataTileWidget.png?alt=media\&token=4ca25ad8-91e9-49ab-a74e-58b3563b2580)

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

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to update data on Data Tile Widget user can publish JSON object on given **testData** MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON object will be as below.

```
{"testKey":10.2}

// Here, 'testKey' is key defined for Data Tile widget.
```

![Configure Data Tile Widget](https://365492316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7aTljSjWsfbXZ_OP_9%2Fuploads%2FV5DtVB4qigXbWuzmYNBN%2FgmapSorceMQTT.png?alt=media\&token=57feeb42-36c5-4bc5-a853-610b43986d1b)

**Using Action**

Here, to update the data on Data Tile widget, output of the action should contain JSON object as given in above example. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Data Tile Widget](https://365492316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7aTljSjWsfbXZ_OP_9%2Fuploads%2FPdeSdWUL4NsDyWWlmQ11%2FdataTileSoureMQTT.png?alt=media\&token=82deadb7-4c4e-4806-86fe-3024723f3299)

#### Event Handling

Data Tile widget does not support any event.

#### Example

If we configure Data Tile Widget as below:

1. key - testKey
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 Tile Widget will look as shown in image.

```
// Data over configured MQTT Topic

{ 
    "testKey":89.98
}
```

![Data Tile Widget Example](https://365492316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7aTljSjWsfbXZ_OP_9%2Fuploads%2FB1dyAE5J2KZwDe8JdQlA%2FScreenshot%202022-01-15%20at%204.25.38%20PM.png?alt=media\&token=18d73962-1640-4848-a5a8-eb1a43b84648)
