Skip to content

Presentation rules

Presentation rules compute the two text labels every record carries: the primary display name and the secondary subtitle line. Each rule pairs a text template (what to render) with an optional condition (when the rule applies) and belongs to one target slot, DisplayName or Subtitle. Rules are stored on the entity definition, so the same labels appear wherever the record is shown or referenced.

Rules are evaluated per target slot in ascending sort order. The first rule whose condition evaluates to TRUE wins and its template is rendered; later rules in the slot are not tried. An empty condition always matches, so a condition-less rule at the end of the slot acts as the default.

If no rule matches, or the winning template renders only empty text, the display name falls back to the record’s Number and the subtitle is simply omitted.

The condition uses the same profile as field behavior conditions: fields of the record, first-level reference paths (Customer.IsBlocked), and the shared operators — comparisons, AND/OR/NOT, text operators, IN, NOT IN, null/empty checks. Variables such as @today, function calls, and the BETWEEN range operator are not available here; write a range as >= low AND <= high (BETWEEN is available only in statements and validation rules — see Availability by surface).

Nickname IS NOT EMPTY
Status = 'archived'

A template is plain text with { … } placeholders. Inside a placeholder you can use:

  • a field path: {Name}, {Customer.DisplayName};
  • a literal: {'fallback'}, {42}, {TRUE}, {NULL};
  • a text function call: {upper(Code)}, {lower(Email)}, {trim(Code)}, {coalesce(Nickname, Name)};
  • a Select caption lookup: {optionLabel(Category)}. The argument must be a direct path to a Select field.

Field paths can reach:

  • scalar fields of the record’s primary table (Table fields are excluded);
  • the system value {Number};
  • first-level Reference paths — the referenced record’s Id, Number, DisplayName, Subtitle, and its scalar fields;
  • Money sub-values through .Amount and .CurrencyCode.

A Reference as a whole is not a template value: write {Customer.DisplayName}, {Customer.Number} or {Customer.Id}, not {Customer}. Template coalesce skips null and whitespace-only text but keeps 0 and FALSE; its arguments are evaluated eagerly. See the template function reference.

Fields protected by field-level access rules cannot be used: presentation output is visible to everyone who can see the record, and a rule that references a restricted field is skipped at runtime.

Missing values render as empty text. The final result is whitespace-normalized: consecutive whitespace collapses to single spaces and the text is trimmed, so a template like {Code} — {Name} degrades cleanly when one side is empty.

Date and time placeholders use workspace display formats automatically. For example, {Customer.BirthdayDate} uses the workspace date format when BirthdayDate is a Date field. Date and Time values do not shift time zones; DateTime values are converted to the workspace time zone. No time-zone name or offset is appended automatically. The same formatting applies inside text functions such as trim.

Display fields use the reader’s language for month/day names, with workspace formats and time zone. Stored display names and subtitles use workspace language so they are consistent for every reader. After workspace language or time-zone settings change, existing stored names/subtitles refresh in the background; they can retain their previous text until that refresh finishes. Existing templates need no syntax change.

optionLabel(SelectPath) renders the configured option caption without changing the stored value. For example, when Category stores logistics and that option is configured as Логістика, {optionLabel(Category)} renders Логістика, while {Category} still renders logistics. A null value renders empty text. An unknown or removed option renders its raw stored key. A multi-select preserves stored order and joins captions and fallback keys with , . Resolution is culture-independent apart from the configured caption. Changing a referenced field from Select to another type is rejected while an active workspace presentation or display-field rule still calls optionLabel for that path; update the dependent rule first.

Two DisplayName rules — a specific rule first, a default last:

Condition: Nickname IS NOT EMPTY
Template: {upper(Code)} — {Nickname}
Condition: (empty — always matches)
Template: {upper(Code)} — {coalesce(Name, 'unnamed')}

Presentation rules are part of the record type’s display settings, edited together with numbering in the Constructor. Through the Configuration API the update-display-settings operation (PUT /api/workspace/admin/entity-definitions/{entityDefinitionId}/display-settings) persists the complete rule list with sort orders and row versions.

Validate a condition or template before saving with the validate-rule-expression operation (POST /api/workspace/admin/entity-definitions/{entityDefinitionId}/rule-expressions/validate) using ContextType Presentation and ExpressionType Condition or Template. The shared validation contract is described on Rule expressions.