These are some advanced pre-defined functions you can use with your field values in the formula section of the document editor.
Function | Description |
random(n) | Get a random number in the range [0, n). If n is zero, or not provided, it defaults to 1. |
fac(n) | n! (factorial of n: "n * (n-1) * (n-2) * … * 2 * 1") Deprecated. Use the ! operator instead. |
min(a,b,…) | Get the smallest (minimum) number in the list. |
max(a,b,…) | Get the largest (maximum) number in the list. |
hypot(a,b) | Hypotenuse, i.e. the square root of the sum of squares of its arguments. |
pyt(a, b) | Alias for hypot. |
pow(x, y) | Equivalent to x^y. For consistency with JavaScript's Math object. |
atan2(y, x) | Arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians. |
roundTo(x, n) | Rounds x to n places after the decimal point. |
map(f, a) | Array map: Pass each element of |
fold(f, y, a) | Array fold: Fold/reduce array |
filter(f, a) | Array filter: Return an array containing only the values from |
indexOf(x, a) | Return the first index of string or array |
join(sep, a) | Concatenate the elements of |
if(c, a, b) | Function form of c ? a : b. Note: This always evaluates both |