Build your first dashboard
For: implementers. Setup: ModularIoT (the web app at modulariot.com/app).
You will learn to:
- create a dashboard and add a widget;
- write a SQL query that returns one row with a number per state;
- show those numbers in a Stacked Stat (KPI per state + 100% bar);
- show the detail in a table;
- filter the table with a select filter;
- share the dashboard.
The result is a dashboard of requests: at the top, how many are in each state; below, the list. It takes about 30 minutes.
Before you start
| You need | Why | If you do not have it |
|---|---|---|
| Dashboards in the navigation | It is where dashboards are created | Ask an administrator to turn it on (Deploy with ModularIoT) |
| The Contributor dashboard role or higher (roles) | With the Consumer role you can only view dashboards | Ask an administrator for the role |
| The organization Owner role, to save SQL queries | Administrators can read and run queries, not save them | Ask an Owner to save the queries of steps 3 and 5 |
| A BigQuery connection with a service account | To write the SQL queries | Steps 1 and 2 work without it. See Connect BigQuery |
The example uses a solicitudes (requests) table with these columns. Replace the names with your table’s.
| Column | Type | Example |
|---|---|---|
id | STRING | S-1042 |
estado (state) | STRING | pendiente, en_curso, cerrada |
responsable (owner) | STRING | North team |
creada_en (created at) | TIMESTAMP | 2026-10-01 09:30:00 |
Create the dashboard
- Open Dashboards in the navigation.
- Select Create Dashboard.
- In Name, type
Requestsand select Create.
The dashboard opens empty, with an Add Widget button in the middle. Changes save on their own a few seconds after each edit.
Add a Stacked Stat with fixed data
Start with numbers typed by hand to see the widget before connecting data.
-
Select Add Widget, type
Stackedin the search box and choose Stacked Stat. The widget appears with sample data (“Traffic Sources”). -
Turn on Edit Mode at the top right. From now on the button to add widgets is under the grid.
-
Hover over the widget and open its settings (the gear).
-
In the Visualization tab:
-
Chart Type: Bar. Donut draws a ring with the same parts.
-
Title:
Requests by state. -
Unit: delete the default
%. -
Categories: the widget comes with four sample categories. Change the first three and delete the fourth with the trash icon. Pick each color with the row’s color circle:
Label Value Color Pending12yellow In progress7blue Closed30green
-
-
Select Save at the bottom of the panel.
The widget shows a bar split in three parts, proportional to 12, 7 and 30, and a legend with each number. The widget does not change while you edit its settings; you see the change when you save.
Pitfall: if you do not delete the % in Unit, the legend shows 12%. The Esc key does not close the color picker: it opens the unsaved changes dialog. Choose Keep editing.
Write the summary query
A Stacked Stat reads one row: the first row the query returns. Each category reads one column of that row. So the query turns the states (rows) into columns.
-
Go to Settings › Connections and open BigQuery, under Editors.
-
Choose your connection in Connection and select + New.
-
Write the query:
SELECT COUNT(*) AS total, SUM(CASE WHEN estado = 'pendiente' THEN 1 ELSE 0 END) AS pendiente, SUM(CASE WHEN estado = 'en_curso' THEN 1 ELSE 0 END) AS en_curso, SUM(CASE WHEN estado = 'cerrada' THEN 1 ELSE 0 END) AS cerrada FROM `my-project.operations.solicitudes` -
Select Run. You should see one row:
total pendiente en_curso cerrada 49 12 7 30 -
In Query settings, under the editor, change Name to
resumen_estadosand select Save.
Only SELECT queries can be saved. Under the editor, Will read shows how many bytes the query will read. A query saved here appears right away as an Operation of that connection in the organization’s dashboards.
Try it without your own table. Replace the FROM with this sample table. It generates 49 requests and reads 0 bytes:
WITH solicitudes AS (
SELECT
FORMAT('S-%04d', n) AS id,
CASE WHEN n <= 12 THEN 'pendiente' WHEN n <= 19 THEN 'en_curso' ELSE 'cerrada' END AS estado,
CASE MOD(n, 3) WHEN 0 THEN 'North team' WHEN 1 THEN 'South team' ELSE 'Central team' END AS responsable,
TIMESTAMP_SUB(TIMESTAMP '2026-10-30 12:00:00', INTERVAL n * 7 HOUR) AS creada_en
FROM UNNEST(GENERATE_ARRAY(1, 49)) AS n
)
SELECT
COUNT(*) AS total,
SUM(CASE WHEN estado = 'pendiente' THEN 1 ELSE 0 END) AS pendiente,
SUM(CASE WHEN estado = 'en_curso' THEN 1 ELSE 0 END) AS en_curso,
SUM(CASE WHEN estado = 'cerrada' THEN 1 ELSE 0 END) AS cerrada
FROM solicitudesUse the same WITH solicitudes AS (…) at the start of the detail query in step 5.
Connect the widget to the query
A dashboard uses a query through a saved query: a short name that widgets choose.
-
Go back to the dashboard. With Edit Mode on, open the dashboard settings menu (the gear next to Edit Mode) and choose Saved queries.
-
Select Add query and fill in:
- Result name:
resumen. - Connection: your BigQuery connection.
- Operation:
resumen_estados. - Parameters (JSON):
{}.
- Result name:
-
Select Apply to draft. This adds the query to the dashboard. The dashboard saves on its own; there is no publish step. Close the menu by clicking outside it.
-
Open the Stacked Stat settings. In the Data Provider tab, set Data Source to Planner and choose
resumenin Variable. The available columns appear below:total,pendiente,en_curso,cerrada. -
In the Visualization tab, replace each category value with a template that names the column:
Label Value Pending{{pendiente}}In progress{{en_curso}}Closed{{cerrada}} -
Change Title to
Requests by state ({{total}})and select Save.
The widget shows the real numbers. {{column}} is replaced by that column’s value in the first row.

Pitfall: if the widget shows Error: Could not load query results right after you add the saved query, reload the page. The server runs the query from the saved dashboard, and autosave takes a few seconds.
Data Source options:
| Option | The widget reads |
|---|---|
| Planner | A saved query of the dashboard, chosen in Variable |
| Static (JSON) | Data typed into the widget itself |
Add the detail table
A table reads all the rows of its query. One query row is one table row.
-
In Settings › Connections › BigQuery, create another query,
detalle_solicitudes:SELECT id, estado, responsable, FORMAT_TIMESTAMP('%Y-%m-%d %H:%M', creada_en, 'America/Santiago') AS creada_en FROM `my-project.operations.solicitudes` WHERE (IFNULL(@estado, '') = '' OR estado = @estado) ORDER BY creada_en DESC LIMIT 500 -
Under Parameters, a Declare @estado button appears. Select it. The parameter gets type
STRING. -
Leave Test value empty and select Run. All states come back: the query receives
NULLandIFNULLtreats it as empty. -
Type
en_cursoin Test value and run again. Only those rows come back. -
Save the query.
-
In the dashboard, add a saved query:
-
Result name:
detalle. -
Connection: your BigQuery connection.
-
Operation:
detalle_solicitudes. -
Parameters (JSON):
{ "estado": { "kind": "filter", "key": "estado", "defaultValue": "" } }
-
-
Select Add Widget and choose Data Table V2.
-
In its settings, Data Provider tab, set Data Source to Planner and Variable to
detalle. The available columns appear below. -
In the Visualization tab, check Columns: the sample columns are replaced by
Id,Estado,ResponsableandCreada En. Change Title toRequest detailand select Save.
If Columns still shows the sample columns (Vehicle, Client…), the query had not run yet. Save, reload the page and choose detalle in Variable again.
FORMAT_TIMESTAMP turns the date into text. Without it, the table shows a BigQuery TIMESTAMP as a number (1.7933364E9).
@estado is a BigQuery parameter. The binding {"kind": "filter", "key": "estado"} gives it the value of the estado filter, which you create in the next step. While the filter is empty, the server sends defaultValue (""). The condition IFNULL(@estado, '') = '' then lets every row through.
Pitfall: a BigQuery query always receives all its parameters. Do not use omitWhenEmpty with BigQuery: if the parameter is left out, the query fails. Use defaultValue.
Filter the table by state
-
Open the dashboard settings menu and choose Filter Bar.
-
Select Add filter and fill in:
-
Filter type: Select.
-
Display label:
State. -
Parameter key:
estado. It must matchkeyin the query binding. If left empty, it is derived from the label. -
Turn on Allow a single selection.
-
Options source: Manual (typed by hand).
-
Options: select Add option three times. Label is what the user sees; Value is what the query receives:
Label Value PendingpendienteIn progressen_cursoClosedcerrada
-
-
Select Save in the panel.
-
Turn off Edit Mode. The filter appears above the widgets as a State button.
Open State and choose In progress. The table reloads and shows 7 rows. The page address changes to ?estado=en_curso; you can share that link with the filter applied. The Stacked Stat does not change because its query does not bind the estado filter. The summary always shows every state.

Clicking a part of the Stacked Stat bar does not filter the table. The filter bar is the way to do it.
Share the dashboard
- Open the settings menu and choose Access Control.
- Select Manage permissions.
- Find your colleague under Users, choose the Reader role (Consumer) and select Add.
Your colleague can open the dashboard and use the filter, but cannot change it. To let them edit, give them Editor. In the UI, Reader, Contributor, Editor and Administrator are the roles Consumer, Contributor, Editor and Coordinator.
What you built
| Piece | Reads | Query shape |
|---|---|---|
| Stacked Stat | The first row of resumen | One row, one column per state |
| Data Table V2 | All rows of detalle | One row per request |
estado filter | — | Gives a value to the @estado parameter |
Next steps
- More query shapes (percentages, charts, date filters): Queries for widgets.
- Which widget fits each design: Choose a widget.
- Every filter type: Add filters.
- Every widget: Widget catalog.
- Roles and permissions: Organizations, scopes and roles.