Ubidots provides different tables widgets to visualize your data, one of the most versatile is Values Table widgets, which allows users not only to display numerical data but also texts, dates, URLs, and images.

image.png

Requirements

Table of Contents

  1. Create a Values Table widget

  2. Create a Values Table widget containing context data

  3. Advanced appearance section

1. Create a Values Table widget

Values table provide a list of the most recent recorded readings.

Step 1: Click on the top-right "+" button
Step 2: Select Values table.
Step 3: Add a value column.
Step 4: Set all the available fields:
Column name
– Select the aggregation method
– Select the Color behavior
– Display the Device name (optional)
Step 5: Edit actions when on click or double click a variable's value.
Set dashboard device: “Set” the Dynamic Dashboard device with the device to which the variable in question belongs.
Go to device: It takes you to the device view in a new tab, showing the device to which the variable in question belongs.
Go to variable: It takes you to the variable view in a new tab, showing the variable in question.
Go to dashboard: Opens a new tab with the Dashboard specified by the user.
Go to URL: Opens a new tab with the specified URL.

Moving to the general Appearance section:
Step 6: Set all the available fields:
Name of the Table
– Set the Decimal places
– Set a Date format
– Select Border and Border width
– Select variables per page
– If any, enter a Custom Style for your widget


2. Create a Values Table widget containing context data

To enhance the appearance of your tables and customize the visualization you need for your clients, you can now use context to store URLs, Images, dates, and text (see table below).

Context type

Description

Payload example

Single line text

Displays the text on a single line. If it is longer than the width of the column, it will put "..." at the end.

{"weather_code":{"value":800, "context":{"description": "Clear sky"}}}

Long text

Displays the text on a single line. If it is longer than the width of the column, it will be display in several lines.

{"weather_code":{"value":800, "context":{"description": "The weather condition in London is light rain"}}}

Number

Displays a number with the specified decimals, color and units.

{"weather_code":{"value":800, "context":{"temperature": 30.5}}}

Date

Display a date in the specified format

{"weather_code":{"value":800, "context":{"date":"2021-11-29 15:25:11 -05:002}}}

URL

Make the content a hyperlink that opens in a new window.

{"weather_code":{"value":800, "context":{"icon_url":"http://openweathermap.org/img/wn/01d@2x.png"}}}

Image

Display a JPG, PNG, BMP, TIF, or GIF file, using the image link as a source. A maximum image size of 256px x 256px must be rendered.

{"weather_code":{"value":800, "context":{"icon":"http://openweathermap.org/img/wn/01d@2x.png"}}}

Once you are familiar with the type of context you can send, simply proceed to create a values table containing data context following the steps below.


Step 1: Click on the top-right "+" button
Step 2: Select Values table.
Step 3: Add a context or value column
Step 4: Set all the available fields:
Column name
– Enter the context key
– Select the Context type
– Display the Device name (optional)

Moving to the general Appearance section:
Step 5: Set all the available fields:
Name of the Table
– Set the Decimal places
– Set a Date format
– Select Border and Border width
– Select variables per page
– If any, enter a Custom Style for your widget

3. Advanced appearance section

To add an extra layer of customization to the values table and its content, the following fields were added and can be modified per column.

Item

Description

Font Family

"Montserrat", "Nunito", "Open sans", "Roboto Mono"

Font Size

Default 14 px

Alignment

Left, right, center

Min width

Minimum width of the column in px.


Other developers also found helpful...

Did this answer your question?