Amazing Fields Formula Syntax

This article is a technical reference for the formula syntax used in Amazing Fields. Use it when building formulas as well as when you need to know which operators are available, how comparisons work, or how to write conditional expressions.

Formulas are evaluated using the Jexl library. The libary allows formulas that are very similar to Excel and Google Sheets but also has a few differences and extra supported operations.

Operators

Unary operators

Operation Symbol
Negate !

For example: !CompletedField  

Binary operators

Operation Symbol
Add / Concatenate (Adds two numbers together, or joins two text strings end-to-end) +
Subtract (Subtracts the second value from the first) -
Multiply (Multiplies two numbers together) *
Divide (Divides the first number by the second, returning a decimal result) /
Divide and floor (Divides the first number by the second and rounds down to the nearest whole number) //
Modulus (Returns the remainder after dividing the first number by the second. For example, 10 % 3  returns 1, because 3 goes into 10 three times (making 9), with 1 left over. This is commonly used to check whether a number is even or odd) %
Power of (Raises a number to the power of another. For example, 2 ^ 8    returns 256   ) ^
Logical AND (Returns true only if both conditions are true. For example, IsActive && HasBudget    is only true when both fields are checked) &&
Logical OR (Returns true if at least one condition is true. For example, IsUrgent || IsOverdue    is true when either field is checked) ||

For example: (4 + 5) * 6  

Comparisons

Comparison Symbol
Equal ==
Not equal !=
Greater than >
Greater than or equal >=
Less than <
Less than or equal <=
Element in array or string in

in   operator checks for a substring in a string, or an element in an array:

•      "Cad" in "Ron Cadillac"   is true

•     "coarse" in ['fine', 'medium', 'coarse']   is  true

For example: NameField == "John Snow"  

Important: Always use ==   for equality comparisons. A single =   is not supported and will not work.

Ternary (IF/Then) expressions

A conditional expression lets you return different values depending on whether a condition is true or false. It follows a simple three-part structure: Condition ? Value if true : Value if false

In other words: "If this is true, return this, otherwise return that."

The ?   separates the condition from the true result. The :   separates the true result from the false result.

Expression Result
"" ? "Full" : "Empty" Empty
"foo" in "foobar" ? "Yes" : "No" Yes
ProgressField > 70.0 ? "Good" : "Bad" Good

Value types

Type Examples
Booleans (A simple yes/no value. Typically comes from a Checkbox field) true   , false   
Strings (Plain text) "Hello", 'Hey there!'
Numerics (Any whole or decimal number) 6, -7.2, 5, -3.14159
Arrays (A list of values wrapped in square brackets, separated by commas. Typically comes from a multi-select Dropdown field) ['hello', 'world!']

Note: Boolean values must be lowercase (true and false). Using TRUE or FALSE will cause an error.

Groups (Parentheses)

Parentheses work exactly as in standard maths and spreadsheet formulas.

Expression Result
(83 + 1) / 2 42
1 < 3 && (4 > 2 || 2 > 4) true

Constant values

Identifier Description
NULL Represents an empty value. Clears the field to contain nothing.
CURRENT_VALUE The current value of the field. Useful to determine if the field has been set yet or not.

Clearing a field with a formula

There are cases where you need a formula to remove a field's value entirely rather than calculate something. To do this, return the constant NULL  , this tells Amazing Fields to clear the field so it contains nothing.

In the example below, a checkbox field called DoCalc   determines whether a total price should be calculated. If the checkbox is ticked, the formula multiplies Price   by Quantity  . If it is not ticked, the field is cleared.

Card Context (Beta)

This is a beta capability and may have some consistency issues.

There is beta support for accessing some card details as part of the formula.  All card values are accessed through the card   property.

Property Description
card.name The card's title
card.desc The card description
card.due Due date
card.start Start date
card.dueComplete Whether the due date is marked complete
card.listName Name of the list the card is in
card.url URL of the card
card.id Full card ID
card.idShort Short card ID
card.address Card address (if set)

Note: Visibility and value formulas using card context are only re-evaluated when these card values change and the current user has write access to the board (for example, if they can modify the Amazing Fields values).

For more information on common function references, see the complete list of supported formula functions.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us