
Overview
The Compare Block allows you to perform comparison operations between two input values. It supports various comparison functions including equality, inequality, less than, greater than, and logical operations such as AND, OR, XOR, NAND, NOR, and XNOR.Inputs
The first value for comparison. Required.
The second value for comparison. Required.
The comparison function to use. Only available when “Use Comparison Function Input” is enabled in settings.
Outputs
The result of the comparison operation.
Editor Settings
The comparison function to be used for the operation. Available options are:
==: Equal to!=: Not equal to<: Less than>: Greater than<=: Less than or equal to>=: Greater than or equal toand: Logical ANDor: Logical ORxor: Logical XORnand: Logical NANDnor: Logical NORxnor: Logical XNOR
When enabled, adds a “Comparison Function” input port that can override the comparison function setting.
Example: Compare two numbers
- Create a Compare Block and set the
Comparison Functionto>. - Create two Number Blocks, one with the value
5and the other with the value3. - Connect the Number Blocks to the
AandBinputs of the Compare Block respectively. - Run the flow. The output of the Compare Block will be
true, because 5 is greater than 3.
Error Handling
If input A is not provided:- For
==comparison: Returnstrueif B is also not provided,falseotherwise - For
!=comparison: Returnstrueif B is provided,falseotherwise - For all other comparisons: Returns
false
B) to the type of the first input (A).
FAQ
What happens if the inputs are not of the same type?
What happens if the inputs are not of the same type?
If the inputs are not of the same type, the block will attempt to coerce the second input (
B) to the type of the first input (A). If the coercion is not possible, the comparison will be performed with the original values.Can I use the Compare Block to compare arrays or objects?
Can I use the Compare Block to compare arrays or objects?
Yes, you can use the Compare Block to compare arrays or objects. The comparison will be performed using a deep equality check that compares all nested values.


