Forms and data
Expressions reference: operators, functions and variables
The complete expression language used for branch conditions, Visible when, Required when and calculations, with every operator, function and variable.
Last updated
Expressions are short rules such as form.amount > 10000. ProcessIQ uses them in four places: branch conditions on a Condition step, Visible when, Required when and Calculation on form fields. Expressions have no side effects. They read values and return a result.
Variables
| Variable | Meaning | Where it works |
|---|---|---|
form.<key> | The answer to a form field, using its Key | Everywhere |
vars.<name> | A value kept from an API call under Keep from the answer | Branch conditions |
requester.name, requester.email | The person who submitted the request | Branch conditions |
requester.id, requester.departmentId, requester.branchId | Internal identifiers of the requester, their department and branch | Branch conditions |
Rules on form fields can use only form.<key>. A missing value is empty (null), not an error. You cannot reach inside a list by position.
Literals
- Numbers:
10000,0.075,-5. No thousands separators or exponents. - Text in single or double quotes:
'USD',"Finance". A backslash escapes the next character. true,falseandnull.- Lists:
['Finance', 'Legal'].
Operators
From lowest to highest precedence:
| Operator | Meaning |
|---|---|
|| | or |
&& | and |
! | not. It applies to the whole comparison that follows it. |
== != < <= > >= in | Comparison. Use one per expression part; chain with &&. |
+ - | Add and subtract. + joins text if either side is text. |
* / | Multiply and divide. |
- (before a value) | Negative. |
( ) | Grouping. |
==ignores letter case for text.'usd' == 'USD'is true. Numbers compare as numbers, soform.amount == 100works for a number field.<and>compare numbers, or two pieces of text in plain character order. Other combinations are false.intests a list:form.department in ['Finance', 'Legal']. The right side must be a list, such as a literal or a Multi-select answer.&&and||treat values as true or false. Empty,null,false,0, empty text and an empty list count as false. Everything else is true.- Arithmetic on a value that is not a number gives an empty result. Dividing by zero does not give a usable number, so guard against it.
Functions
| Function | Returns |
|---|---|
len(x) | The number of characters in text, or items in a list. Empty gives 0. |
contains(x, y) | For text, true if x includes y, ignoring case. For a list, true if x has an item equal to y. |
lower(x) | The text in lower case. Anything else gives empty. |
isEmpty(x) | True if x would count as false. Note that 0 and false count as empty. |
These four are the only functions. There are no date functions, and no way to read today's date. A function name that does not exist fails when the rule runs, so check each rule with Simulate.
Examples that work
form.amount > 10000
form.amount > 10000 && form.currency == 'USD'
form.department in ['Finance', 'Legal']
!form.urgent
lower(form.country) == 'nigeria'
contains(form.reason, 'refund')
len(form.justification) > 50
isEmpty(form.notes)
form.quantity * form.unitPrice
(form.base + form.bonus) / 12
'Order ' + form.reference
form.amount >= 1000 && (form.type == 'capex' || form.type == 'project')
vars.orderId != nullLimits and checks
- An expression can be up to 2000 characters.
- Validation rejects syntax errors, roots other than
form,varsandrequester, and form fields that do not exist. - Simulate uses your sample answers, but has no API results and no requester details, so rules on
varsandrequesterare not meaningful there.
The expressions are used in conditions and branching and conditional and calculated fields. Fields themselves are covered in form fields and validation. To write them with help, try describe a workflow with AI or the AI prompt guide.