Calculate a value from other fields
Compute a number from other columns, e.g. a line total.
Use case
You want a column to hold a number derived from other columns — for example a line total computed from amount and price.
Snippet
// Treat missing values as 0 so the result is always a number.
const amount = objNew.amount || 0;
const price = objNew.price || 0;
return amount * price;Notes
Give the formula column a numeric type so the result is stored as a number.
Guarding with
|| 0avoidsNaNwhen one of the inputs is empty.Only fields that are part of the object's data (on
objNew) are available. To use a value from a linked object, see Read a value from a linked object.
Last updated