Calculation Fields
A Calculation field is a virtual column whose value is computed live from a SQL formula. It always reflects the latest data in the record (and any related records), but it never stores a value of its own and cannot be edited.
Use calculations when you want a derived value to stay in sync — totals, statuses, formatted strings, age in days, related counts.
Adding a calculation
In a table's Configure screen, open the Fields tab, click Add Field, and choose Calculation. Give it a label, then enter the formula. The editor shows a live preview against a real record so you can sanity-check the result before saving.
Formula language
The formula is MySQL. Other fields are referenced through tokens, not raw column names.
Same-row references
@{this:field_id}
Pulls the value of field_id from the same row.
Cross-table references
When the table has a lookup pointing at another table, you can pull values from the linked record:
@{200:name}
…where 200 is the target table's id. The token expands into a small subquery that follows the lookup. If your table has more than one lookup to the same target, disambiguate with the lookup field's id:
@{200:name:billing_customer}
Aggregates across related records
When another table looks up this table, you can aggregate the related rows:
@{1234:item_count} // count of related rows
@{1234:sum:amount} // sum of a column
@{1234:avg:rating} // average
@{1234:max:created_at} // most recent
@{1234:min:due_date} // earliest
Aggregates count every relationship from the child table back to this row. Date aggregates skip empty/epoch values automatically.
Recipes
Domain from an email field:
SUBSTRING_INDEX(@{this:email}, '@', -1)
Full name:
CONCAT_WS(' ', @{this:first_name}, @{this:last_name})
Days until a due date (negative = overdue):
DATEDIFF(@{this:due_date}, CURDATE())
Line total (NULL-safe):
IFNULL(@{this:qty}, 0) * IFNULL(@{this:unit_price}, 0)
Status bucket:
CASE
WHEN @{this:score} >= 90 THEN 'A'
WHEN @{this:score} >= 75 THEN 'B'
WHEN @{this:score} >= 60 THEN 'C'
ELSE 'F'
END
Invoice balance (paid against the order total, from a related payments table):
@{1234:sum:amount} - @{1235:sum:paid_amount}
Decimals
Calc fields have a Decimals setting that controls how a numeric result is formatted in grids and record views. The formatting is presentational — the underlying SQL result is unrounded. If you need the value itself rounded, wrap the formula:
ROUND(@{this:price} * @{this:tax_rate}, 2)
What calc fields cannot do
- Cannot be written to. The field is excluded from forms, the API, and webform submissions. The Required, Default Value, and Admin Only settings do not apply.
- No side effects. A calc field returns a value; it cannot send an email, call a webhook, or update another record. That work belongs in an automation.
- No
JOIN,UPDATE,INSERT,DELETE, orDROP. A short blacklist blocks these to keep formulas read-only. Use tokens for related data — the engine builds the necessary joins behind the scenes. - No circular references. A calc can reference another calc, but the chain is capped at five hops. Deeper chains throw a Recursion error at save.
- No spreadsheet syntax.
RIGHT(),VLOOKUP(),=A1+B1are not valid. The language is MySQL.
When to use a flow instead
| You want | Use |
|---|---|
| A live, derived value that always reflects current data | Calculation field |
| To freeze a value at the moment of create or update | Automation that writes a regular field |
| To send mail, call an API, or modify another record | Automation |
| Behavior that depends on the user | Automation |
| Pure aggregation over related records | Calculation field |
Calculations are the right answer when the value is a pure function of data already in the database. Anything stateful, external, or one-shot belongs in an automation.
Renaming or deleting referenced fields
Tokens reference fields by id, not by label. Renaming the label of a referenced field is safe. Changing the SQL column (id) breaks any calc that references it — InfoLobby does not rewrite formulas automatically. Open the calc, fix the token, save.
Deleting a referenced field will cause the calc to fail at query time with an "Unknown column" error. Update or remove the calc before removing its source.