Skip to content

This page is for integrators who write criteria or field paths directly — through the API, a package, or a hand-edited payload. Builders who create conditions in the designer never type these paths; the designer writes them. Criteria conditions appear on five distinct API surfaces in OSOS: view criteria, saved queries, statistic-query aggregation paths, reaction trigger criteria, and reaction action Dynamic value paths. Each surface resolves the condition’s field-path string in its own way, and the dialects are close enough to look interchangeable while being different enough to bite. This page is the single reference for which dialect each surface requires, why, and what a wrong choice looks like at run time.

Entry field data is stored under the value property of every entry document, so most surfaces want the field’s full normalized name prefixed with value. — but not all of them, and not for entry-metadata paths.

SurfaceRequired dialectExample pathA wrong choice yields
View criteria (filter.criteria + quick filters)value.<fullNormalizedName>; entry metadata un-prefixed (state, creationInfo.doneAt)value.amountHTTP 200, empty entries array
Saved queries (DataQuery.criteria, incl. as a view’s data source)Same as view criteria — merged into the same filter at query timevalue.status.idHTTP 200, empty entries array
Statistic-query aggregation (aggregation.field, aggregation.groupByField)value.<fullNormalizedName>; metadata exceptions un-prefixed (creationInfo.doneAt/doneBy, updateInfo.doneAt/doneBy); relation hops value.<field>.:relation.value.<field>value.departmentOne bucket with category: null; Sum/Average over the missing path yield 0/null
Reaction trigger criteria (DataReaction.criteria)value.<field> (legacy) or canonical scope.entries.<entityNormalizedName>.value.<field> — never barevalue.priorityCriteria never match; the trigger is silently skipped
Reaction action Dynamic value pathsCanonical scope.entries.<entityNormalizedName>.value.<field>; value.<field> and bare known field names are auto-expandedscope.entries.task.value.assigneeAction fails with a recorded error in the trigger execution history

Rule of thumb: always write the value. prefix. It is required on the first three surfaces and accepted (auto-expanded) on both reaction surfaces. The one reaction surface where bare names genuinely are the dialect is not a criteria path at all: the DataEntryUpdated event’s eventConfig.fields watch-list, which matches bare fullNormalizedName values.

Why each surface reads paths the way it does

Section titled “Why each surface reads paths the way it does”

When a view’s entries are fetched, the data service merges the request’s filter.criteria, the view’s query-type data-source criteria, and any active quick-filter query into one filter expression, then hands it to the query engine with no field scope. The engine uses the condition’s field string verbatim as the match key, and the resulting $match runs directly against stored entry documents — whose field values all live under the document’s value property. That is the whole dialect: value.<fullNormalizedName> reaches your data, while entry metadata such as state or creationInfo.doneAt sits at the top level of the document and is therefore written without the prefix.

Nothing checks the path at save time either: the save-time parse of a query’s criteria validates operators only — an unknown operator or an unsupported field expression is rejected, but a syntactically fine path aimed at the wrong level sails through and simply matches nothing later.

GET /v2/entities/{entity}/statistic-queries/{id}/execute runs the stored aggregation. Internally, the service strips the value. prefix from aggregation.field / aggregation.groupByField only to look the field up on the entity — the caller’s raw string is kept as the lookup path and interpolated verbatim into the $unwind / $group / $addFields pipeline stages. Because entry documents nest data under value, the paths must be value.-prefixed to hit anything; the backend’s own contract for these paths is value.<fieldName> (or creationInfo.<doneAt> for metadata). Relation hops use the :relation marker: value.<field>.:relation.value.<field>. Metadata is again the exception, handled without the prefix: creationInfo.doneBy / updateInfo.doneBy and creationInfo.doneAt / updateInfo.doneAt.

A worked example, with the numeric aggregation-function enum the model requires (Count = 0, Sum = 1, Min = 2, Max = 3, Average = 4):

{
"aggregation": {
"aggregationFunction": 1,
"field": "value.amount",
"groupByField": ["value.department"]
}
}

Write "field": "amount" instead and the pipeline groups on $amount — a key absent from every document — so every entry collapses into one category: null bucket and the sum is 0, with no error anywhere.

One adjacent footgun on the same surface: source.store must be the entity’s normalized name. The store is looked up by normalizedName only, and at execution time the string is used verbatim as the MongoDB collection name. Passing a valid entity id or a display name fails at save time with the misleading Entity <store> not found (ENTITY_NOT_FOUND) — the entity exists, it just is not found under normalizedName. (The store’s schema pattern also rejects UUID hyphens and spaces outright.)

Reaction criteria are not evaluated against the live entry document. The trigger context is flattened into a synthetic entry whose value object holds keys like scope_entries_<entityNormalizedName>_value_<field>; that entry is inserted into a temporary collection, and the criteria paths are rewritten to match it — scope.entries.<entity>.value.<path> and legacy value.<field> both map onto the flattened keys.

A bare path is untouched by that rewrite, and the engine’s field-scope logic then strips the first path segment — which for a single-segment bare path leaves the empty string. The condition becomes a match on "", which matches nothing, and the trigger is skipped. So the reaction-criteria dialect is effectively the same value. anchor as views: write value.<field>, or the full scope.entries.<entityNormalizedName>.value.<field> form.

If you have seen bare field names “work” in reactions, that was the DataEntryUpdated watch-list (eventConfig.fields) — a list of bare fullNormalizedName values that selects which field changes fire the event, not a criteria path.

A Dynamic value on a reaction action is not resolved through MongoDB at all: it is a property lookup over the in-memory trigger context. The resolver accepts three dialects — canonical scope.entries.<entityNormalizedName>.value.<field>, legacy value.<field> (auto-expanded to the canonical form), and a bare <fullNormalizedName> when it matches a known field. The value. prefix therefore always works here too, but this is the one surface where it is not required.

Category and switch fields match the option id

Section titled “Category and switch fields match the option id”

A category field’s stored value carries the option object, and criteria compare against its id:

  • In / Not in with option objects: the engine’s explicit category case rewrites the match key to value.<field>.id and maps each argument to its id, compiling to {"value.<field>.id": {"inq": ["<optionId>", …]}} (nin for Not in).
  • Equal / Not equal with an object argument expand per key: {"id": "<uuid>"} becomes {"value.<field>.id": {"eq": "<uuid>"}}.
  • Statistic group-bys append .id to the group-by path for category and switch fields, then resolve each result bucket’s id back to its display label — category options from the field’s configured option list, switch values from the entity’s internal collections.

The option id is a plain required string in the schema; it is a UUID by front-end convention, not by schema enforcement. Match against the option id, never the label. For example, an In condition:

{
"field": "value.priority",
"args": [{ "id": "0b9f3c2e-…" }, { "id": "6d41a8f0-…" }]
}

compiles to {"value.priority.id": {"inq": ["0b9f3c2e-…", "6d41a8f0-…"]}}.

In / NotIn with a single reference or category value Since 1.10

Section titled “In / NotIn with a single reference or category value Since 1.10”

In and NotIn match a reference field on <field>.dataEntry and a category field on <field>.id, reducing each argument to that id. Before 1.10 the reduction only ran when the resolved value was already a list. A single object — a filled Parameter from a single-select input (status: {id: 'doing'}), or a reaction criterion such as assignee In scope.me() — stayed whole inside the $in and matched nothing, with no error.

Both query engines (the data service’s and the reaction service’s) now compile the pair the same way: the value is wrapped in a list first, then an element carrying dataEntity + dataEntry switches the key to .dataEntry, and an element carrying id switches it to .id. The rewrite is chosen by inspecting the values, not the field’s data type — so a hand-written criterion with a bare id string is still compared verbatim. In reaction criteria a null element in a reference list no longer throws.

The Expression value source and its result shape Since 1.10

Section titled “The Expression value source and its result shape Since 1.10”

A criteria argument of type Expression (FilterExpressionValueTypeEnum.FieldExpression, 2) holds a JavaScript expression string; a non-string value is refused at save time. Both engines evaluate it as a global expression — with no entry in scope — and put the raw result into the condition. There is no casting by field type, so it matches only when it returns the shape the field stores.

The query builder offers the Expression source for these field types, each with the result it must produce (shown as a hint under the box):

Field typeThe expression must return
Texta string
Numbera number — 10, not '10'
Date / Date-time / Timea string in the stored format (e.g. yyyy-MM-dd), not a Date object
Booleana boolean
Reference{dataEntity, dataEntry} — e.g. scope.me(), not a bare id

In / NotIn accept the same type or a list of it. Category, localized text, JSON / geo, file, icon and block fields do not offer the source. A wrong shape is only a warning in the editor — the editor type-checks the expression against the accepted types, but Apply is never blocked — so a mismatching expression can still be saved and then silently matches nothing, exactly like a wrong field path. The end-user entries Filter panel uses the same auto-complete expression editor as the admin builder; the editor’s code is loaded only when an Expression row is rendered.

Reaction criteria resolve both @today() and @now() — the expression scope also contains @StartOfDay, @StartOfWeek, @StartOfMonth, and @StartOfYear. What differs between the two headline tokens is the return shape, and that difference is the real footgun:

TokenResolves in reaction criteria?ReturnsUse with
@now('±N<unit>')YesFull ISO datetimeDateTime-typed comparisons only
@today('±N<unit>')YesDate-only string (start of local day, with a hard-coded +2h offset before formatting)Date-typed fields

Because @now() yields a full datetime, an equality or range comparison against a date-only stored value never matches — which presents exactly as “@now() doesn’t work in reaction criteria”, even though the token resolves fine. Use @today('±Nd') for date-only fields and reserve @now() for DateTime comparisons.

Manipulation grammar, shared by both tokens:

  • The amount must be signed: '+1d', '-3w'. An unsigned amount such as '1d' is silently ignored and the base date is returned.
  • Units: d days, w weeks, M months, y years, h hours, m minutes, s seconds.

A pointer that fails to evaluate is not silent: expression execution throws an ExpressionExecutionException.

Silent or loud: where a wrong path surfaces

Section titled “Silent or loud: where a wrong path surfaces”
SurfaceSave-time checkWrong path at run timeVisible where
View / saved-query criteriaOperator validation only — never a bad-path error$match on a nonexistent key → HTTP 200, empty entriesNowhere
Statistic-query aggregationField-lookup failures are caught and loggedOne category: null bucket; Sum of a missing field → 0Nowhere — the response shape looks valid
Reaction trigger criteria—Criteria never match; the trigger is skippedA service log line only; no trigger-history record
Reaction action Dynamic path—Throws Path "<path>" does not exist in the context.; resolution failures are wrapped as INVALID_ENTRY_FIELDRecorded in the trigger execution history and the service error log — nothing surfaces to the originating request

The trigger execution history is the only place a wrong Dynamic path is visible; from the caller’s point of view even the loud failure looks quiet.

Everything on this page is long-standing behaviour, unchanged from the 1.2 line through the current development line, except the two sections marked Since 1.10 (In / NotIn with a single value and the Expression value source), which carry their own badges.

Platform 1.10.0 · Backend 1.11.0-alpha.11 · Frontend 1.11.0-alpha.6 · Mobile 1.10.2 · Chart 1.11.8 · Gateway 2.6.11 · MCP 0.2.0 · Grafana DS 1.2.0Docs build 2026-11-27