Compare
Uncontrolled node
Overview
Compare two values and return true or false.
Compare checks two values and returns a boolean. Connect the result to If when you want the comparison to choose an execution path.
It is evaluated when another node needs its output; it does not require an event trigger.
Inputs
| Input | Type | Description |
|---|---|---|
| a | Data | The first value. |
| b | Data | The second value. |
Properties
| Property | Type | Description | Default |
|---|---|---|---|
| operation | Choice | Comparison between a and b: <, <=, ==, >= or >. | == |
Choose operation in the properties panel.
Comparison choices
| Operation | Meaning |
|---|---|
a < b | Less than |
a <= b | Less than or equal to |
a == b | Equal; the default selection for a new node |
a >= b | Greater than or equal to |
a > b | Greater than |
Outputs
| Output | Type | Description |
|---|---|---|
| result | Boolean | true when the selected comparison matches, otherwise false. |
Choose the right value types
For numeric comparisons, supply numbers using Number or To Number. If both values are text, ordering is textual: "10" is less than "2".
Equality can treat different types as equal, such as the number 10 and text "10". It is not a strict type check or a comparison of the contents of entire lists and objects. Compare individual fields for record validation.
Example
Connect a numeric total to a, a Number node containing 100 to b, and select a >= b. Connect result to If's test, then trigger If to choose the appropriate action.