Device query
Query device readings with a time range, conditions and optional aggregation.
Device query reads a device's historical readings over a time range, optionally filters and aggregates them, and returns the matching rows as a list later steps can use.
When to use it
Use it to bring device data into a workflow — list last week's temperature readings in a report, check the highest pressure in the past day before approving a job, or get an hourly average for a summary email.
Settings
| Setting | What it does |
|---|---|
| Device | The device to query. Pick a workspace device (Fixed), or a Variable holding a Device or text containing a device ID. |
| Device profile | Follows the device. Its parameters are what you can filter, return and group by. Use Refresh profile parameters after the profile changes. |
| Time range | Start and End. Each can be a fixed date, relative to the current time (e.g. 7 days ago), a date variable, or a date formula. Start is inclusive, end is exclusive, and calendar calculations use the workflow time zone. |
| Conditions | Optional, up to 50. Compare a parameter with a value: equals, does not equal, greater than, greater than or equal, less than, less than or equal, contains, is empty, is not empty. All conditions must match the same reading, and they apply before aggregation. |
| Parameters | The columns to return, 1 to 100. Each has an Aggregation — None / Raw, Average, Minimum, Maximum, Sum, Count, First, Latest / Last or Median — and optional Decimal places (0–10). |
| Group by | Optional. Group readings by up to 10 parameters and/or a Time interval (an interval size and unit: seconds, minutes, hours or days). Needs an aggregation; each combination of values and interval produces one row. |
| Result settings | Sort by (reading time by default) and Sort direction (descending by default), and a Row limit from 1 to 500 (100 by default). |
Open preview runs the query with the current settings and shows the rows it returns. Variables are only resolved when the workflow runs.
Variables
With marker D1:
| Variable | Type | Notes |
|---|---|---|
D1.items | Array | The returned rows. Each row has Reading time and one value per selected or grouped parameter. Use it as a Loop source or a report table. |
D1.matchedRows | Number | How many rows matched. |
D1.truncated | Boolean | Whether more rows matched than the row limit returned. |
Paths
One output, whether or not any readings matched. Use a Condition Router on Matched rows to handle "no data".
Example
A daily Scheduled Trigger runs a Device query on a cold-room
sensor for the last 24 hours, returning the maximum temperature per hour. A
Generate Report step turns D1.items into a table and
Send Email sends it to the facilities team.
Notes
- Long time ranges or many parameters can hit the query's time or capacity limit. Choose a shorter range or fewer parameters if a run fails.
- Device query replaces Read Data Set for new workflows. Existing Read Data Set blocks keep running.