Skip to main content

Views

Views define how a list of objects is displayed as a table or column-based overview. A class can have multiple views — a default view, a relation view, and any number of named views.

Definition​

{
"name": "openTasks",
"defaultView": false,
"relationView": false,
"defaultSort": "dueDate,desc",
"values": [
{ "name": "title" },
{ "name": "status", "dataType": "LIST", "list": "my-project.taskStatus" },
{ "type": "RELATION", "relatedClass": "commons.person" }
],
"filter": [
{ "name": "status", "value": "open" }
],
"navigateBehaviour": "OVERLAY_PAGE"
}
PropertyTypeDescription
namestringOptional name. When set, this view is selected by name matching (e.g. in a VIEW layout item with the same name).
defaultViewbooleanWhen true, used as the default for class dashboards and unnamed view embeds.
relationViewbooleanWhen true, used for related-object list tabs (rendered by RELATED_VIEW layout items).
defaultSortstringDefault sort order in REST API format: fieldName for ascending, fieldName,desc for descending.
valuesLayoutItem[]Column definitions. Each entry is a FIELD or RELATION layout item.
filterViewFilter[]Static pre-filters automatically applied when this view is displayed.
filterControlFilterControlNamed preset filters the user can switch between above the table, e.g. active / inactive / all. See Preset filters.
navigateBehaviourNavigateBehaviourFallback used when an embedding VIEW or RELATED_VIEW layout item does not declare its own navigateBehaviour. See Navigate behaviour.

Columns​

The values array defines which columns are shown in the view. Each entry uses the same structure as Layout items — only FIELD and RELATION types are supported here.

"values": [
{ "name": "lastName" },
{ "name": "firstName" },
{ "type": "RELATION", "relatedClass": "commons.company" }
]

Column aggregations​

Add "aggregate" to a column entry to show a totals row at the bottom of the table. The totals row recalculates whenever the active filter changes.

"values": [
{ "name": "description" },
{ "name": "units", "aggregate": "SUM" },
{ "name": "amount", "aggregate": "SUM" },
{ "name": "spentExternal", "aggregate": "AVG" }
]
ValueDescription
"SUM"Sum of all visible values.
"AVG"Average of all visible values.
"COUNT"Count of rows that have a value for this field.

Only fields with data type INTEGER, DECIMAL, CURRENCY, or PERCENTAGE produce a result — other data types are silently ignored.

Platform properties as columns​

Every object has three properties that the platform maintains itself. They can be used as columns without declaring a field; their names start with _, which a field name never does:

ColumnShows
_classThe object's concrete class, with its translated singular label (e.g. Sales dossier, Client agreement).
_creationDateWhen the object was created.
_modificationDateWhen the object was last changed.
"values": [
{ "name": "title" },
{ "name": "_class" },
{ "name": "dueDate" },
{ "name": "_modificationDate" }
]

The _class column needs no manual LIST field or per-class formula. It mirrors the subclass filter syntax below: the same _class name can be used in filter to restrict the view to a specific concrete class instead of displaying it.

These columns are for display: a user cannot sort, filter or total on them.

Filters​

filter defines static pre-filters that are always active for this view. These cannot be overridden by the user.

PropertyDescription
nameWhat to filter on: a field name, the qualified name of a relation's class, or _class to restrict to a specific concrete class.
valueThe filter value. Not required for EMPTY and NOT_EMPTY.
operatorFilter operator. Omit to use the default (EQUALS).

Operators​

OperatorBehaviorvalueApplicable data types
EQUALS (default)Exact match. Case-insensitive for text fields. For LIST fields, value may be comma-separated to match any of the listed keys.RequiredAll
FROMGreater than or equal (≥)RequiredDATE, DATETIME, INTEGER, DECIMAL, CURRENCY, PERCENTAGE
TOLess than or equal (≤)Requiredsame
STARTS_WITHPrefix match (case-insensitive)RequiredTEXT, TEXTBLOCK, EMAIL; relations (matched by display name)
EMPTYField has no valueOmitAll
NOT_EMPTYField has a valueOmitAll

Examples:

Exact match on a value field (default EQUALS):

{ "name": "status", "value": "active" }

Relation filter — only objects linked to a specific object of a relation's class:

{ "name": "commons.country", "value": "nl" }

Subclass filter:

{ "name": "_class", "value": "my-project.contractor" }

Multiple values on a LIST field (matches either key):

{ "name": "contractStatus", "value": "ACTIVE,PENDING" }

Date range — show only records with a due date in January 2026:

{ "name": "dueDate", "operator": "FROM", "value": "2026-01-01" },
{ "name": "dueDate", "operator": "TO", "value": "2026-01-31" }

Prefix match on a text field:

{ "name": "companyName", "operator": "STARTS_WITH", "value": "Acme" }

Only records where a field is not filled in:

{ "name": "closedAt", "operator": "EMPTY" }

Only records where a field has a value:

{ "name": "signedAt", "operator": "NOT_EMPTY" }

Negation​

Excluding specific values (e.g. status != 'INACTIVE') is not supported. Use a boolean calculated field as a workaround:

{ "name": "contractActive", "formula": "contractStatus != 'INACTIVE'" }

Then filter on that field:

{ "name": "contractActive", "value": "true" }

Preset filters​

filterControl adds a single-select control above the table, so users can switch between named sets of filters (for instance active, inactive and all dossiers) without building column filters by hand. Each preset is a list of the same ViewFilter entries that filter uses: there is one filter grammar, not a second one.

"filterControl": {
"default": "active",
"presets": [
{ "key": "active", "label": "LABEL:active", "filter": [{ "name": "status", "value": "ACTIVE" }] },
{ "key": "inactive", "label": "LABEL:inactive", "filter": [{ "name": "status", "value": "PENDING,INACTIVE" }] },
{ "key": "all", "label": "LABEL:all", "filter": [] }
]
}

FilterControl​

PropertyTypeDescription
defaultstringThe key of the preset that is selected initially. Required.
presetsFilterControlPreset[]The choices, in the order they are shown.

FilterControlPreset​

PropertyTypeDescription
keystringIdentifies the preset. Referenced by default.
labelstringThe text of the choice, as a label key such as LABEL:all, translated like other labels.
filterViewFilter[]The filters this preset applies. Operators and value rules are those of Filters.

Behaviour​

  • Combined with the base filter. The selected preset is combined (AND) with the view's filter, which is always applied. A preset can only narrow the view further, never relax the base filter.
  • An empty preset adds nothing. "filter": [] shows everything the base filter allows. It does not remove the base filter.
  • Presets are explicit. There is no implicit "all" choice: if users should be able to see everything, declare a preset with an empty filter, as all above.
  • The default decides the count. The count badge on a tab uses the default preset, so the number on the tab and the rows initially shown in the table come from the same definition. The count does not follow the user's later selection.

In the example above, active shows objects whose status is ACTIVE, inactive those with PENDING or INACTIVE (a comma-separated EQUALS value matches any of the keys), and all every object. With a base filter on _class, each of the three presets stays within that class.

Selecting views​

Views are selected by the platform as follows:

  • Class dashboards — the view with defaultView: true is used.
  • VIEW layout item — if name is set, the view with that name is used; otherwise the view with defaultView: true.
  • RELATED_VIEW layout item — the view with relationView: true is used; if name is set, the view with that name is used instead.

Example​

A class with two views — a default view for the list page, and a named compact view for embedding:

"views": [
{
"defaultView": true,
"defaultSort": "name",
"values": [
{ "name": "name" },
{ "name": "status" },
{ "name": "dueDate" },
{ "type": "RELATION", "relatedClass": "commons.person" }
]
},
{
"name": "compact",
"defaultSort": "dueDate",
"values": [
{ "name": "name" },
{ "name": "dueDate" }
],
"filter": [
{ "name": "status", "value": "open" }
]
}
]