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.
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 field types are silently ignored.

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 value type field name, a relation type as a TypeFQN string, or "type" to restrict to a specific concrete subtype.
valueThe filter value. Not required for EMPTY and NOT_EMPTY.
operatorFilter operator. Omit to use the default (EQUALS).

Operators

OperatorBehaviorvalueApplicable field 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 type:

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

Subtype filter:

{ "name": "type", "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" }

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" }
]
}
]