during normal execution, i.e., the value is constant. When associated with an identifier, a constant is said to be "named", although the terms "constant" and "named constant" are often used interchangeably. This is contrasted with a
, which is an identifier with a value that can be changed during normal execution, i.e., the value is variable.
In Coda 😇
Variables and constants in Coda are those values you need to use in a formula somewhere in a table (or on the canvas) which can be calculated only once, in a helper table, instead of calculating them for each row in that table.
This can be very useful in terms of performances but also, to re-use such values throughout the entire doc 😊 (without the need to recalculate them, once again).
A common example of variable/constant : Now()
I’ll admit when using variables/constants in Coda, I personally don’t take their general definition into account and just create solely variables 😇.
One of the variable I use the most is Now() as depending of the precision, Now() can quickly create performance issues (as if you need “seconds”, it means that Now() gets recalculated every seconds, for “minutes”, it will be recalculated every minute and so on...).
As mentioned before, using variables/constants in a doc, works like using
but instead of storing templates, you store those calculated values you wish to use in your formula in a single row helper table and in your formula, you @-ref the needed variable/constant where needed 😊.
If you need more variables/constants in your doc, just add a column (instead of rows, in this case) 😉.
Here👇 is an example when using Now() as a variable in