Skip to main content
View as Markdown

Computed & Action Fields

Four field types nobody types a value into. Three are derived — the engine computes them from other data — and one is a control that runs something when clicked. All share the base field properties.

Type Stores / does
formula A value computed from a formula expression.
count A count of related records.
autonumber A database-assigned auto-incrementing integer.
button An interactive button triggering a URL or automation.

For the value-holding types — json, array, color, code, geolocation, barcode — see Structured & Media Fields.

formula

Computes a value from an expression referencing other fields.

Property Description
formula Required, non-empty. Expression to compute. Supports field references and functions.
resultType Expected data type of the result (e.g. string, number, boolean, date).
format Display format for the result (e.g. currency, percentage, decimal, date).
currency ISO 4217 code the amount renders in (EUR, GBP, …). Defaults to USD.
precision Decimal places, 010. Defaults to 2.
symbolPosition before (default) or after the amount.
negativeFormat minus (default) or parentheses.
thousandsSeparator comma (default), period, space, or none.
app.yaml
- { id: 1, name: total_price, type: formula, formula: 'price * quantity', resultType: number }

Money computed by a formula

A formula over currency fields is money, but it does not inherit the currency of the fields it references — an expression may touch several fields or none, so there is nothing to inherit from without guessing. Declare the code:

app.yaml
- id: 12
  name: unit_price
  type: currency
  currency: EUR
  precision: 2
- id: 27
  name: stock_value
  type: formula
  formula: unit_price * stock_on_hand
  resultType: number
  format: currency
  currency: EUR

Omit currency and the amount renders with the USD default — which is why stock_value used to print $224,430.90 in the column beside the €28.63 it was computed from.

The five display properties are the same ones a currency field accepts, and they behave identically.

count

Counts records linked through a relationship field in the same table. A simplified rollup.

Property Description
relationshipField Required, non-empty. Name of the relationship field in this table whose links to count.
filters Optional filter expression — count only the linked records that match.
app.yaml
- {
    id: 2,
    name: completed_task_count,
    type: count,
    relationshipField: tasks,
    filters: { field: status, operator: equals, value: completed },
  }

autonumber

A database-assigned auto-incrementing integer — the field type behind invoice and order references. The column is a sequence, so the value is allocated by the database on insert and is never supplied by the client.

app.yaml
- { id: 3, name: invoice_number, type: autonumber }

That produces 1, 2, 3, and so on. autonumber takes no options: there is no prefix, no starting offset, and no zero-padding. For a human-facing reference like INV-01000, add a formula field that composes the number with the prefix and padding you want — that keeps the presentation in one place and leaves the underlying sequence untouched.

button

An interactive button rendered on records.

Property Description
label Required, non-empty. Button text.
action Required. Either url or automation — nothing else is accepted.
url URL to open. Required when action is url.
automation Automation name to run. Required when action is automation.
visibleWhen Show the button only on records matching a condition. Omit to show on all.
app.yaml
- {
    id: 4,
    name: approve,
    type: button,
    label: Approve,
    action: automation,
    automation: approve_request,
  }

action is a closed two-value vocabulary. action: url demands url; action: automation demands automation. Any other value — including an empty string — is rejected at startup, because action is the dispatch key both the renderer and the invoke endpoint switch on: a value neither recognises would render a button that does nothing.

The automation it names must have a manual trigger to be invocable this way.

Showing a button on some records only

visibleWhen names a record field and applies the shared condition vocabulary (eq, neq, in, notIn, contains, gt, lt, gte, lte) to its value. Supply several operators and all must hold. This is the same grammar a data-table action uses, so "show this control on some records" reads the same wherever you write it.

app.yaml
- {
    id: 5,
    name: ship,
    type: button,
    label: Ship,
    action: automation,
    automation: ship_order,
    visibleWhen: { field: status, eq: pending },
  }

json

Moved to Structured & Media Fields.

array

Moved to Structured & Media Fields.

color

Moved to Structured & Media Fields.

code

Moved to Structured & Media Fields.

geolocation

Moved to Structured & Media Fields.

barcode

Moved to Structured & Media Fields.

Last updated August 11, 2026

This documentation was written with AI, so errors or outdated content are possible. Sovrium is in beta. Contributions and corrections are welcome.

Built with Sovrium