ProcessMaker 4.1
ProcessMaker API Documentation
ProcessMaker Examples
Powered By GitBook
Expression Syntax Components for "Visibility Rule" Settings
Use this expression syntax to determine how controls in your Screen show or hide in run-time.

Expression Syntax Components for "Visibility Rule" Settings

Use the following expression syntax components to compose the expression that describes under which condition(s) a Screen control displays. See an example.
If an expression in a control evaluates as True, then that control displays during a Request. If an expression in a control does not evaluate as True, then that control does not display during a Request.
Spaces are allowed before and after expression components, such as arithmetic and comparison operators, to more easily read the expression.
Combine expressions using logical operators. Example: (not approved) or (cost > 500).

First Rule for the Visibility Rule Setting

If a Screen control does not have an expression in its Visibility Rule setting, then that control displays by default.

Use Magic Variable Values in Expressions

Magic Variables can be used in when composing Visibility Rule expressions.

Use Request Variable Values as Dynamic Values in Expressions

Request variable values can be used when composing Visibility Rule expressions. For example, to dynamically compare the _user.id Magic Variable value that represents the unique identifier for the user against a Request variable called BusinessBankerID that represents the current Request variable value derived from a Collection during a Request, use the "equal to" comparative operator to compare those values: _user.id == businessBankerId

Visibility Rules Override Custom CSS

If a Screen control affected by a visibility rule is hidden by default from custom CSS, the visibility rule overrides the custom CSS design. For example, if custom CSS is designed to hide a Screen control by default when that control's visibility rule dictates that it be visible, the visibility rule overrides the custom CSS to display that control. As a best practice, use visibility rules instead of custom CSS to hide a control by default.

Literals

Component
Syntax
Expression Example
string
"hello" or 'hello'
FullNameInput == "Louis Canera"
number
100
cost > 500
array
[value1, value2]
myFruit not in ["apples", "oranges"]
Boolean
true and false
directorSigned

Arithmetic Operations

Component
Syntax
addition
+
subtraction
-
multiplication
*
division
/

Logical Operators

Component
Syntax
not
not
and
and
or
or
Consider the following example common for Select List controls configured to allow multiple selections. Suppose a Select List control with a Variable Name setting of SelectListControl that stores single values has the following options:
    Beatty
    Fred
    Nancy
    Tom
To configure another control in that Screen to remain hidden if the Fred option is not among the selections, use the following expression in the Visibility Rule setting for the control that is to remain hidden:
not("Fred" in SelectListControl)

Comparison Operators

Component
Syntax
equal to
==
not equal to
!=
less than
<
greater than
>
less than or equal to
<=
greater than or equal to
>=

String Operator

Component
Syntax
concatenate matches
~

Array Operators

Component
Syntax
contains
in
does not contain
not in
Consider the following example common for Select List controls configured to allow multiple selections. Suppose a Select List control with a Variable Name setting of SelectListControl that stores single values has the following options:
    Beatty
    Fred
    Nancy
    Tom
To configure another control in that Screen to remain hidden if the Fred option is not among the selections, use the following expression in the Visibility Rule setting for the control that is to remain hidden:
not("Fred" in SelectListControl)

Range

Component
Syntax
Example
range
..
foo in 1..10

Related Topics

Last modified 25d ago