The Expression Editor allows you to write more powerful conditions for rules. Follow the steps below to see an example of how to write a condition in the Expression Editor.
When editing a condition in the Condition editor, click the Expression Editor from the bottom left:

When the Expression Editor opens, the existing condition is translated into the Expression Editor automatically.

A condition might involve converting three number fields to a date, and seeing if it is in the future. The number fields in this example are named Year, Month, and Day. There is also a button that, when clicked, alerts the user if the date is in the future.

A rule is added to the button that alerts the user. The default condition for a rule is “true”. This needs to be modified to something more useful.

When the expression editor is opened, the “true” component of the condition is visible. The “true” is deleted, to be replaced with a new condition.

Next, the structure of the condition is created. The dropdown is used to insert the “Today()” function, followed by the “is less than” symbol (because a date in the future is greater than today), and finally the “Date()” function. The “Today()” function will evaluate to the current date, and the “Date()” function is used to construct a date from user input.

The Date() function takes three numbers as parameters, which need to be inserted inside its parentheses. The three number fields are inserted in year, month, and day order.

The Expression will now work as intended, and can now be saved by clicking OK. It will now appear in the Rules panel.
Regardless of which method is used, more complex conditions can be created. In this example, we want to add more checks to ensure the fields are not empty. To add additional conditions, use parentheses to isolate that condition. Combined with the And operator, each one of the conditions is checked. Using the And operator means each sub-condition must be true in order for the whole condition to be true.

NOTE: The Expression Editor allows nesting of operators and functions using parenthesis. Here, using a previous example, “1” is added to the Year field when it is converted to a date, making the date on the right one year in the future.
