Skip to content

3. Compass Record Selection — DataGrid

In this step you select the Compass record that the DataGrid (Table) widget will use. Your record returns a multi-column result; all columns are automatically added to the table, and which ones are visible is controlled in Step 7.

Wizard route: /cartography/add/selectcompass

Prerequisite

Steps 1 (DataGrid) and 2 (Table) must be completed.

02 — Chart Type Selection


1. Compass Record List

Query selection screen


2. Suitable Record Structure for DataGrid

-- Last 50 alarms
SELECT
    ts                     AS time,
    makine_adi             AS machine,
    alarm_kodu             AS code,
    aciklama               AS description,
    oncelik                AS priority
FROM alarm_log
ORDER BY ts DESC
LIMIT 50;

DataGrid queries can be multi-column. All columns are brought to the table; visibility is managed in Step 7.

Add a LIMIT

If the query returns unlimited rows, the widget will slow down. Recommended upper limit: 500 rows. Use a date-filtered query:

SELECT ... FROM alarm_log
WHERE ts >= NOW() - INTERVAL '24 hours'
ORDER BY ts DESC
LIMIT 500;

Date Format

Return the date column as formatted text with TO_CHAR(ts, 'DD.MM.YYYY HH24:MI') — it reads much better in table cells.


3. Compatible Data Sources for DataGrid

Data Source DataGrid Compatibility
PostgreSQL / MSSQL / MySQL ✅ Ideal — multi-column query
REST API ✅ Suitable — JSON array of objects
MQTT ❌ Not suitable — single message is not a table
Excel Offline ✅ Suitable — sheet maps directly to a table

4. Search and Tag Filter

Action Effect
Search box Instant filter
Tag filter Only tags in use
Clear Reset filters

DataGrid Tags

Use table, list, log tags in Compass for DataGrid queries.


5. Confirm the Record

When you click a record the row is highlighted. Click the Next button at the top right to proceed.

Proceeding Without Selecting a Record

If no record is selected, Next gives a warning.


6. Excel Offline Sheet Selection

For Excel records, an additional Sheet dropdown appears.


7. Preview Execution

When you press Next, the record is executed and the table result is loaded. After this step you go directly to Step 7.


8. Common Errors

Symptom Likely Cause Resolution
Table comes back empty Query returns no rows Test the query in Compass
Very slow loading No LIMIT, millions of rows Add a date filter + LIMIT 500
Column names unreadable No AS alias Use AS english_name in SQL

9. Next Step

07 — General Design