Skip to main content
A computed field gets its value from a formula instead of user input. Use it for totals, prices with tax, full names, or counts of related records.

Create a computed field

1

Add a field

Add the field that will hold the result, for example order_total.
2

Make it computed

Choose Computed and build the formula in the expression editor.
3

Pick the result type

number, string, boolean, date, or json.
4

Choose null handling and persistence

See the options below.

Operations

add, subtract, multiply, divide, modulo, pow, abs, round, round_even, floor, ceilArithmetic uses exact decimals, so money stays accurate.

Expression format

Formulas are stored as an expression tree. The dashboard builds it for you; this is what it looks like:
An invoice’s paid_amount can be the sum of its payments’ amount. Each payment links to its invoice with a relation field.
  1. On Invoices, add a number field paid_amount and make it computed.
  2. Choose the aggregation Sum, the collection Payments, and the field amount.
  3. Turn Persisted on, so the total is stored and can be filtered and sorted.
The total is updated in the same transaction as the payment change: when a payment is created, edited, moved to another invoice, trashed or restored. With the null strategy zero, an invoice without payments shows 0.

Options

Bludia tracks dependencies between fields, so changing an input (including a related record) recalculates the values that depend on it.
Computed fields are read-only. Values sent by clients for them are rejected.