Kinabase Logo
Help & Support

Computed Fields

Calculate values and build dynamic text automatically


Computed Fields

work out their own value from the data in other fields - much like a spreadsheet formula. A Total that multiplies quantity by price, an Expiry date that adds 30 days to a start date, or a Priority that reads High when a score is above 80: all of these update by themselves whenever the fields they depend on change, so no one has to recalculate them by hand.

This guide explains the computed field types and shows you how to write the formulas that power them.


1. The computed field types

There are five computed types, plus Conditional Text for template-driven writing. Two related types - Lookup and Aggregation - pull data from other collections and have their own guides.

Field typeWhat it producesExample
Computed (Number)A number from a calculation.$QUANTITY * $UNIT_PRICE
Computed (Text)Text built from other fields."Order for " + $CUSTOMER_NAME
Computed (Date)A date worked out from other fields.$START_DATE + days(30)
Computed (Duration)A length of time from a calculation.diff($START, $END)
Computed (Select)An option chosen by a formula.if($SCORE >= 80, "High", "Low")
Conditional TextText picked from templates by condition, then filled with record values.A different quote line for machined vs printed parts.

To pull a single value from a linked record, use a Lookup field. To roll up totals, averages or counts from many linked records, use an Aggregation field.


2. Create a computed field

1. Open the Fields pane

Open the collection

, click the options menu (⋯) and select Configure (or right-click the collection in the sidebar and choose Configure), then under Setup click Fields.

You'll need Configure permission

for the collection. If you're unsure, ask your System admin.

2. Add the field

Click Add field, give it a meaningful Name (such as Total Cost), and set the Type to one of the computed types above.

Choosing a computed field type in the Field Editor

3. Write the formula

Enter your formula in the field's formula box, using the syntax below. Typing $ opens a dropdown of the collection's fields so you can insert them quickly.

4. Save

Click Add field. The computed field recalculates automatically whenever the fields it references change.


3. Writing formulas

Referencing fields

Reference another field with $ followed by its name in capitals, with underscores for spaces - so a field called Unit Price is $UNIT_PRICE. To read a value from a linked record, chain through the link field with a dot, for example $CUSTOMER.EMAIL. To include a literal $ in text, type $$.

Arithmetic

Use +, -, *, / and ^ (power). Put spaces around operators and use parentheses to control order:

($PRICE * $QUANTITY) - $DISCOUNT

Rounding

  • round($VALUE) - to the nearest whole number.
  • floor($VALUE) - down to the nearest whole number.
  • ceiling($VALUE) (or ceil) - up to the nearest whole number.

Each also takes an optional step, for example round($VALUE, 0.5). Use abs($VALUE) for the absolute value.

Logarithms and trigonometry

Use log(value, base), or the shortcuts ln, log2 and log10. Trigonometric functions sin, cos and tan expect radians - convert from degrees by multiplying by pi/180.

Conditional logic

Use if(condition, then, else):

if($COST > 100, $COST * 0.9, $COST)

Comparisons available: =, !=, <, >, <=, >=. Combine conditions with the boolean operators and, or, not and xor.

Handling empty values

The null-coalescing operator ?? supplies a fallback when a field is empty:

$DISCOUNT ?? 0

Working with units

Measurement and currency fields carry units, and you can use them directly. Append a unit to a number or field reference - both SI and imperial units work, and currency symbols count as units:

$AREA * £400,000/ha

Temperatures are calculated in kelvin. Convert a result with kelvin(x), celsius(x) or fahrenheit(x).

Building text

Join text with + (no extra space) or .. (adds a space between the parts):

"Order for " + $CUSTOMER_NAME

To include a literal $ sign in your text, escape it as $$:

"Total: $$" + $AMOUNT

Other useful text functions are uppercase(text), lowercase(text), slice(text, start, end) and characterCount(text), which returns the number of characters in a text field.

A worked example of a computed field formula

Working with dates and durations

Add or subtract time using the duration functions days(n), weeks(n), months(n), years(n), and so on:

$START_DATE + days(30)

Measure the gap between two dates with diff(from, to) (add a third argument for a directional result), or the shortcuts diff_days, diff_weeks, diff_months, diff_years. Snap a date to a boundary with functions such as startOfMonth(d) and endOfWeek(d). now() returns the current date and time.

Function reference

Every function you can use in a formula:

  • Numbers: round, floor, ceiling / ceil, abs, log, ln, log2, log10, sin, cos, tan, kelvin, celsius, fahrenheit.
  • Text: uppercase, lowercase, slice, characterCount.
  • Logic: if.
  • Dates: now, startOf… / endOf… (per unit), diff, diff_days / diff_weeks / diff_months / diff_years, and the duration builders days, weeks, months, years (and finer units).
  • Across records: sum, average, count, accumulate, any, all, filter, intersect, union.

This is the full, supported set. Some names you may see referenced elsewhere - a length function, mode, or a join function - are not available; use characterCount for the length of text.


4. Tips

  • Create a test record to confirm your formula returns what you expect.
  • Use parentheses generously so operations happen in the order you intend.
  • Reference fields in capitals with underscores, for example $FIRST_NAME.
  • Include units in numeric calculations where they matter, for example $MILEAGE * £3.50/mi.
  • Add a clear Description to complex computed fields so colleagues understand them. See Configuring fields.

Need more help? Ask your System admin, or contact our support team via Help & Support.