Skip to content

Formulas and AI fields ​

Three field types compute their own value from the rest of the record: Formula writes the logic yourself, AI asks a model, and AI image generates a picture. All three are read-only cells — you change them by changing their inputs.

Formula fields ​

A formula is a small piece of JavaScript that returns a value. The record's fields arrive as input, keyed by field key:

js
return input.quantity * input.unit_price;

Anything JavaScript can express is fair game:

js
// A status derived from a date
const due = new Date(input.due_date);
if (!input.due_date) return 'No date';
return due < new Date() ? 'Overdue' : 'On track';
js
// Text assembly
return [input.first_name, input.last_name].filter(Boolean).join(' ');

Dependencies ​

Each formula declares what it depends on — the fields that should trigger a recompute. Set them in the field's options.

  • Declare dependencies and the formula recomputes when one of them changes. This is what you want almost always: it's precise and it's cheap.
  • Declare none and it recomputes on every write to the record.

A formula may depend on a lookup or a rollup key, which is what makes the chain in Link records work: line amount → order total → balance.

When you add a formula field — or edit its code — every existing record is backfilled, so you never have to touch rows to wake them up.

When a formula fails ​

A broken formula never blocks a save. The record writes, the cell comes back empty, and the field's error is shown on the cell. Fix the code and recompute.

Formulas cost credits ​

Formula code runs in a secure runner, and that compute is billed to your AI credits like any other compute on the platform. One evaluation per record write covers all the formula fields on that record, and a bulk edit is charged as one batch — the cost is per write, not per field.

Out of credits, formulas pause — they don't block writes

If you run out of credits, Onivos skips the compute rather than refusing the save. Your records still write; formula cells keep their last value; the app tells you the compute was skipped. Top up, then open the field's menu and choose Recompute to repair the column.

The practical consequence: treat a formula cell as possibly stale if you've been near your credit limit. Anything that must be exact at that moment should be recomputed first.

AI fields ​

An AI field asks a model to fill in a cell — a summary of a long note, a category for an incoming request, a detail extracted from unstructured text.

SettingWhat it does
PromptThe instruction. Interpolate the record's fields with {{field_key}} — e.g. Summarise this ticket in one sentence: {{description}}.
OutputText for a sentence, Select to force one of a list of options (the reliable way to classify), JSON for a structured object.
Depends onThe fields that should trigger a regenerate.
AutoOff by default — see below.
ModelWhich model answers.

Three behaviours that differ from formulas ​

  • They're asynchronous. A write doesn't wait on the model. The cell shows pending and fills in when the answer arrives, so saving a record is never slow because it has an AI field on it.
  • They're manual by default. Nothing generates until you ask it to. Turn on Auto per field if you want it to regenerate whenever its dependencies change. A bulk "generate all" shows you the estimated cost and asks you to confirm before it spends anything.
  • The output is structured. Choosing Select constrains the answer to your options — that's the difference between a classifier you can filter and group on, and free text that's nearly one of five words.

Classify, don't chat

The highest-value AI fields are the boring ones: priority, sentiment, category, "does this mention a refund". Pair Select output with a short prompt and you get a column the rest of the platform can automate on.

Budget ​

AI fields consume credits per generation, and there's a monthly ceiling for them. When the ceiling is reached, generation stops with a visible error on the cell — never a silent stall you have to go looking for.

AI images ​

An AI image field generates a picture from a prompt over the record — a product shot from a description, a header image from a title. It behaves like an AI field (async, manual by default, billed per generation) and the result lands in the cell as a real file you can download or reuse.

Choosing between them ​

You want…Use
Arithmetic, dates, string assembly, conditionalsFormula
An aggregate over linked recordsRollup
A value copied from a linked recordLookup
Judgement over unstructured textAI
A generated imageAI image

Reach for a formula before an AI field whenever the answer is deterministic — it's faster, cheaper and it can't be wrong.