How to filter HealthRota reporting data from the Excel add-in — fields, operators, and how values (numbers, text, dates, ranges, multiple ids) are interpreted. The same rules apply wherever you set a filter: the task pane, the =HEALTHROTA.GET function, and the =HEALTHROTA.QUERY function.
The filter model
Every filter is three things:
Part | What it is | Examples |
field | the column to filter on |
|
operator | how to compare |
|
value | what to compare against |
|
Multiple filters are combined with AND — a row only matches if it satisfies all of them.
Operators
Operator | Meaning | Use with | Value |
| equals | numbers, text, dates | single |
| not equals | numbers, text, dates | single |
| less than | numbers, dates | single |
| less than or equal | numbers, dates | single |
| greater than | numbers, dates | single |
| greater than or equal | numbers, dates | single |
| is one of | ids / numbers / text | list (comma-separated) |
| between (inclusive) | numbers, dates | exactly two values (min, max) |
| text contains | text | single |
| text begins with | text | single |
| text ends with | text | single |
Values and how they're read
Numbers — a value that looks numeric is sent as a number (
42,3.5). Use these for ids and numeric fields.Text — anything non-numeric is sent as text (
approved,ward). Don't add quotes in the task pane orQUERYcells; the text is taken as-is.Multiple values (
in) — comma-separate them:1,2,3. Whitespace is trimmed. Each value is read as a number or text as above. This is the normal way to filter by several ids.Ranges (
range) — give two comma-separated values,min,max, and the result is inclusive of both ends. More or fewer than two values is rejected.
The server coerces each value to the field's real type, so a numeric id field gets a number, a date field gets a date, etc. If a value can't be coerced (e.g. text where a number is expected) you get a clear error (see Validation and errors, below).
Dates
The API stores dates as YYYY-MM-DD. You don't have to type that exact format — the add-in converts date values automatically before sending. Accepted inputs for any date field:
You enter | Sent to the API |
|
|
|
|
a date-formatted Excel cell (e.g. |
|
| passed through unchanged |
A field is treated as a date when it is date, from, or ends in _date or _at (start_date, end_date, updated_at, …).
Single-date vs period entities
Single-date resources (e.g.
work_items,time_sheet_items,exception_reports,locum_offer_shifts) expose adatefield. Filter it directly:on/after a day:
dategte2026-01-01a window:
daterange2026-01-01,2026-03-31
Period resources (e.g.
sub_types,job_plans,job_plan_activities,shift_requirements,rota_members,rota_status_periods) exposestart_dateandend_dateas separate fields, so you choose the comparison yourself:starts in 2026:
start_dategte2026-01-01active during March 2026 (overlap):
start_datelte2026-03-31andend_dategte2026-03-01
updated_at is a timestamp on every resource — use it with gte/lte/range and a date (start of that day, UTC) or a full ISO timestamp.
Which fields can I filter?
Each resource accepts its own set of fields. In the task pane the filter "field" box suggests the valid fields for the chosen data type (driven live by the API), so the easiest path is to pick from the list.
Common fields:
ids— the record's primary key.idsin101,102,103, oridseq101.updated_at— last-changed timestamp (good for "what changed since…").date/start_date/end_date— see Dates, above.relation ids — slice by a related entity:
rota_id,user_id,department_id,team_id,location_id,specialty_id,organisation_unit_id,shift_requirement_id,work_item_id, … Useinfor several:rota_idin1,2,3.status— ontime_sheet_itemsandlocum_offer_shifts.
(The authoritative per-type list comes from the API's meta endpoint; the pane reflects it automatically.)
Setting filters — the three ways
1. Task pane (Build a query)
Add a filter row and fill in the three boxes:
field: date op: range value: 2026-01-01,2026-03-31
field: rota_id op: in value: 1,2,3
Add as many rows as you like (combined with AND), choose your columns, then Insert live query. The pane writes the filters into Field / Operator / Value cells and a =HEALTHROTA.QUERY formula that reads them (way 3 below).
2. =HEALTHROTA.GET — filters as a text string
Filters are one string: clauses separated by ;, each written as field op value.
=HEALTHROTA.GET("work_items", "rota_id in 1,2,3; date gte 2026-01-01", "id,date,start,end")
=HEALTHROTA.GET("work_items", "date range 2026-01-01,2026-03-31")
=HEALTHROTA.GET("time_sheet_items", "status eq approved; user_id in 10,11")
Signature: =HEALTHROTA.GET(type, [filters], [columns], [includeHeaders]). Omit filters for everything, omit columns for all columns. type accepts either the resource name (work_items) or the display name shown in the task-pane picker (WorkItems).
3. =HEALTHROTA.QUERY — filters from cells
Point at a range of field | operator | value rows, so the filters live in cells (with your own dropdowns/validation) and the data re-pulls when they change.
A B C
1 rota_id in 1,2,3
2 date gte 2026-01-01
=HEALTHROTA.QUERY("work_items", A1:C2, E1:E3) // E1:E3 = column names to return
Notes for QUERY:
For
in/range, put the comma-separated values in the single value cell (1,2,3).A date-formatted cell works for single-value date operators (
eq/gte/lte) — it's converted automatically. For a daterange, type the two dates as text in one cell (2026-01-01,2026-03-31).Blank rows are ignored.
Validation & errors
Filters are checked before sending, so mistakes come back immediately:
Unknown field — e.g.
deparment_id→ "Unknown field "deparment_id". Available: department_id, rota_id, …" (the pane lists the valid fields for that type).Unknown operator — anything not in the operator table.
Missing value — an operator with no value.
Bad
range—rangewithout exactly two values.Empty
in—inwith no values.
In the task pane these appear in red under the query. In a function they appear as the cell's error message (e.g. hover the #VALUE!). If a bad value still reaches the server (for example text in a numeric field), the API replies with a specific message such as "Invalid filter value 'abc' (expected a date (yyyy-MM-dd))", which the add-in shows verbatim.
Cheat sheet
ids in 101,102,103 # several records by id
ids eq 101 # one record
rota_id in 1,2,3 # by related entity
date gte 2026-01-01 # on/after a day
date range 2026-01-01,2026-03-31# inclusive window
start_date gte 2026-01-01 # period: starts on/after
end_date lte 2026-12-31 # period: ends on/before
updated_at gte 2026-06-01 # changed since (start of day UTC)
status eq approved # text equals
name contains ward # text contains
See also: HEALTHROTA.GET, HEALTHROTA.QUERY, HEALTHROTA.CLAUSE, Getting started.
