Applies to version 2017.1.x; Author: Przemysław Sierant
The Form rule editor has access to constants, global constants, form fields, global form fields and other form rules available to the given process. It can also utilize global form rules which are used to create advanced formulas operating on all of the aforementioned values.
Once defined, Form rules can be set to trigger on:
- Form field value change
- On page load
- On page load and postback
They can be used for:
- Standard form behavior
- Mobile form behavior
- Additional validation on paths
Available functions and operations
Form rules include: arithmetical operations such as addition, subtraction, multiplication and division; logical operations like: AND, OR, NOT; comparison operations: lesser than (<), lesser or equal to (<=), greater than (>), greater or equal to (>=), equal (=), different than (<>) and empty (EMPTY).
Adding, subtracting, multiplying and dividing two numerical values will return a numerical result. Adding text values returns a combined character string as a text. Attempting to subtract, multiply or divide anything else than numerical values will return an error.
Operations of comparison (=) or differentiation (<>) will return TRUE when the numerical values will be equal or different. It is possible to compare two text values without taking character case into account in “InvariantCulture”. If the values are identical, equality (=) will return TRUE and difference (<>) will return FALSE.
Other comparison operations can be used for numbers and dates with the time precision of milliseconds. If the conditions are met it will return TRUE value, if not – FALSE. An attempt to compare textual value will return an error.
Functions – Behavior
SET – one of the most basic functions which enters a specified value into a form field.
The form field „Floating point number” named “Gross amount” will be set to a numerical value of “123.45”. The biggest improvement brought about by Form rules can be observed here – To create this rule the user only needs to know the name of the form field that they wish to initialize (or any other element they wish to affect e.g.: the names of paths, steps, constants, other form rules etc.).
The user also doesn’t need to concern themselves with the syntax of the function. In this example, the SET function only has two available input fields. Every function and operation has a prompt which suggests an example when you mouse-over it. In order for a function or operation to work correctly, one only need to fill out the input fields.