All Collections
User Guides
Create a Values Table Widget in Ubidots
Create a Values Table Widget in Ubidots

Learn how to create Values Table Widget with Ubidots Dashboards

S
Written by Sergio M
Updated over a week ago

Ubidots provides different table widgets to visualize your data and one of the most versatile is the Values Table widget, which allows users not only to display numerical data but also texts, dates, URLs, and images. Also, the Values Table allows for additional things such as editing values directly from the Widget.

image.png

Requirements

Table of Contents

1. Create a Values Table widget

Values tables provide a list of the most recent recorded readings for one or more variables. Please follow these steps to create a Values Table widget:

  1. In a Dashboard, click on the “+” button at the top right corner.

  2. Select the Values Table widget.

image.png

Note: if the Dashboard is dynamic, you can select if the widget's behavior is static (as if the dashboard were a Static Dashboard) or if it’s dynamic.


image.png

3. At this point, you can add multiple ‘date’, ‘value’, or ‘context’ columns in any order that you need:

image.png

Date column:

The date column shows the dates of the values. To add a date column:

  1. Click on the Date option when adding a column.

  2. Set a column name.

  3. Select a date format, or leave it to be “Set by Dashboard”.

  4. Select the desired color for the dates.

image.png

5. If wanted, pick an action for single click and/or double click on the dates, then set the action accordingly.

  • 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 dashboard: Opens a new tab with the dashboard specified by the user.

  • Go to URL: Opens a new tab with the specified URL.

  • Go to variable: It takes you to the variable view in a new tab, showing the variable in question.

image.png

6. Pick and adjust the font, its size, and its alignment.

7. Set the minimum column width, or leave it in ‘auto’ so that it automatically uses a size so that all other columns may also fit.

Value column:

The value column shows the variable's values received within the span selected in the widget. Adding a value column has quite similar options to when adding a date column, except that instead of setting up the date, here the setup is oriented towards which variable to show the data from and how the data is shown.

  1. After clicking on ‘value’ when adding a column, select the device and variable from which the values will be retrieved.

image.png

Note: For static dashboards, the widget will always show the data for the selected variable. For dynamic dashboards, the widget will show the data for the variable with the same label but for the dashboard’s selected device.


2. Set a column name.

3. Select an aggregation method (last value, average, minimum, maximum, sum, count).

  • If the aggregation method is different from ‘last value’, then also select the sample period.

  • Select a span for the data, or leave it to be “Set by Dashboard”.

4. Select the desired color behavior for the values.

  • Set by widget: you can set any color for the values.

  • Color logic: the color of the values will depend on the range of the value.

image.png

5. If wanted, pick an action for single click and/or double click on the values, then set the action accordingly. These actions are the same as in the date column.

6. Enable or disable “allow edition”. This option determines if the values for the variable can be edited directly in the widget.

7. Pick and adjust the font, its size, and its alignment.

8. Set the minimum column width, or leave it in auto so that it automatically uses a size so that all other columns may also fit.

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 use context to store URLs, images, dates, and text (see table below). To add a context column:

  1. After clicking on ‘context’ when adding a column, select the device and variable that will provide or receive the context, similar to how it’s done for a values column.


  2. Decide whether values can be added manually or not by switching the "allow new rows" toggle button.

  3. Enter a name for the column.

  4. Set the context key from which the data will be extracted or where it will be sent to.

  5. Select the type of context that will be shown.

Context type

Description

Payload example

Single line text

Displays the text on a single line. If it’s longer than the width of the column, an ellipsis (...) will appear at the end.

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

Long text

Displays the text on a single line. If it’s longer than the width of the column, it will be displayed 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

Displays a date in the specified format.

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

URL

Turns the content into 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 256 x 256px can be rendered.

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

List

Displays a user-defined list of items that can be posted onto the table.

Note: This option only works when the “allow editing” toggle button is turned on.

Although there’s no payload involved in this type of context, the list is constructed by entering all the items as a comma-separated text:

For example:

Resolved, Pending, Alert, Unknown

6. Select the desired color for the context fields when they are not images or URLs.

7. If wanted, pick an action for single click and/or double click on the values, then set the action accordingly. These actions are the same as in the date column.

8. Enable or disable “allow editing”. This option determines if the context for the variable values can be edited directly in the widget. Only when this option is enabled, the “list” context type works.

9. Pick and adjust the font, its size, and its alignment.

10. Set the minimum column width, or leave it in ‘auto’ so that it automatically uses a responsive size so that all other columns may also fit.

After having set the columns for the date, values and for context, you can now save and view your Values Table widget.

image.png

3. Edit existing values

Value and context columns allow their values to be edited. To do this, simply make sure that the “allow editing” option on the column settings is enabled.

Then, on the widget click on the edit icon at the end of every row to enable editing for the values and/or context.

image.png

Once you have edited the values, you can click on the check mark to save them.

image.png
image.png

4. Add new rows manually

You can manually add any number of values into existing columns of your Values Table. To do this, simply follow these steps:

  1. Enable the "Allow new rows" option, located at the top of the settings.

  2. Click on the "save" button.

  3. Start adding new values by inputting them in the fields that have now appeared below the column names.

  4. To save the values in the table, click on the floppy disk icon. On the other hand, to clear the fields just click on the trash can icon.

Note: if an aggregation method different than "last value" is selected in the settings of a value column, the "allow new rows" option will become disabled.

5. Advanced appearance section

To reflect your application’s branding, you may further customize your widget’s appearance by changing the following values:

  • Decimal points: set the amount of decimals for numerical values.

  • Borders: select the border behavior for the cells in the Values Table widget.

  • Border width: set the thickness or width of the cell borders.

  • Freeze first column and header: enable these two options to fix the first column and/or header in place when you move across your Values Table horizontally or vertically.

  • Values per page: set the maximum amount of values that will be shown per each Values Table page.

  • Background color: pick a background color for the Values Table.

  • Column name color: pick a color for the names of your columns.

  • Alternating row colors: pick one or two colors to alternate between rows. Note that, by default, the transparency (or opacity) of these colors is set to 0 so as not to interfere with the widget's background color.

  • Background image: either upload an image from your computer or paste the URL of one to be displayed in the background of your widget.

  • Custom style: further configure the appearance behavior of the widget. For more information on this functionality, please view this article.


Other developers also found helpful...

Did this answer your question?