Compare
Last updated
Last updated
Compares two values using one of several comparison operators. It evaluates the relationship between the inputs and outputs a boolean (true/false) result indicating whether the comparison is satisfied.
a
The first value to compare
Any
Yes
b
The second value to compare
Any
Yes
operator
The comparison operator to use (=, ≠, >, <, ≥, ≤)
Text
No
value
The result of the comparison (true if the comparison is satisfied, false otherwise)
Yes/No
Drag the Compare node into your graph.
Connect the first value to compare to the "a" input.
Connect the second value to compare to the "b" input.
Select the desired operator from the dropdown (default is "equal").
Run the graph—the output will be true if the comparison is satisfied, false otherwise.
Equal
=
True if a is equal to b
Not Equal
≠
True if a is not equal to b
Greater Than
>
True if a is greater than b
Less Than
<
True if a is less than b
Greater Than or Equal
≥
True if a is greater than or equal to b
Less Than or Equal
≤
True if a is less than or equal to b
For string comparison, the operators follow JavaScript's string comparison rules.
When comparing objects, "equal" means the same exact object, not just objects with the same properties.
Mixing types in comparison may give unexpected results (e.g., comparing a string to a number).
If: For conditionally choosing between two values based on a boolean.
And: For combining multiple conditions, requiring all to be true.
Or: For combining multiple conditions, requiring at least one to be true.
Conditional Logic: Create branching logic based on value comparisons.
Data Validation: Check if values meet specific criteria or thresholds.
Range Testing: Verify if a value falls within or outside a specific range.