All guides

Computed fields

Banner illustration: two tinted input blocks feeding through a pair of short clay marks into a single outlined result box.

A formula over the document's numbers, printed as text: deposits from totals, sums over fields and variables, formatted as number, currency or percent.

About 7 minutes to read and follow along.

A computed value is a piece of printed text whose content is a formula result. Nobody fills it in and no recipient owns it; it recomputes as its inputs change and prints as ink in the PDF. The classic use is a payment term derived from a quote: a deposit of half the total that stays correct while the signer is still deciding which optional rows to keep.

What a formula can say

Formulas are arithmetic: numbers, + - * /, parentheses and negation. Everything else is a reference, written as a dotted name. A reference resolves against a pricing table's totals first (quote.subtotal, quote.discount, quote.tax, quote.total, using the table's "Reference name"), then against a document variable by its token, then against a field by its field name. Braces are allowed but optional: {quote.total} reads the same as quote.total.

Field references read what the signer typed, or the field's default while nothing has been typed, parsed as a number. A field holding "ten" contributes nothing and the formula shows a placeholder instead of a guess.

The inspector carries the same cheat sheet: reference a variable by its name, a numeric field by its field name, and a pricing table by its name.

Formats

  1. Pick a "Format": "Number", "Currency" or "%".
  2. Number and percent honor the "Decimals" setting, zero to six places, with thousands grouping.
  3. Currency prints the way the pricing table prints money, symbol placement included, in the currency you pick for the field.

A worked example: the deposit

  1. Add a pricing table and set its "Reference name" to quote.
  2. Drag a "Computed value" element where the deposit should print.
  3. Set its "Formula" to quote.total * 0.5 and its "Format" to "Currency".
  4. Preview as a signer and untick an optional row: the total drops, and the deposit halves with it. The exported PDF prints the same figures, because all three surfaces run the same evaluation.
The computed value panel in the inspector: a reference name of deposit, a formula reading quote.total * 0.5, and the Currency format selected.
A formula, a format, and the result printed on the page.

When a formula cannot answer

A reference that resolves to nothing prints "#REF" followed by the name that failed, on the canvas and in the PDF alike, so a renamed table or a mistyped token is visible instead of silently zero. A formula that produces no finite number, dividing by zero for instance, prints "#ERR". A formula that does not parse at all is flagged in the inspector the moment you commit it: "This formula does not parse", with the reason.

The v1 limits

Formulas work on numbers only: no dates, no text operations, no conditionals. And a computed field cannot reference another computed field; a chain of derived values renders "#REF" at the second link. Both are deliberate first-version boundaries.

Keep going

Let the assistant draft your document

Updocly sets 2 strictly necessary cookies, used only to keep you signed in, and stores preferences and unsaved drafts in this browser's local storage.

Cookieless analytics only. No tracking, and no third-party cookies.