Compare two numbers (max / min)
The Compare Numbers robot compares two numbers from a Bitrix24 (Alaio) business process or robot and returns three values: the greater one (max), the lesser one (min), and the comparison result — greater, less or equal. It accepts decimal numbers with either a dot or a comma as the separator. Use it to pick the larger value or to branch the process by the comparison outcome.
The robot compares two numbers and immediately returns the greater value, the lesser value, and a text comparison result. The inputs are number A and number B — these can be field values of a deal, lead or contact, or outputs of other robots; decimal numbers are accepted with either a dot or a comma as the separator. The outputs are: max (the greater of the two), min (the lesser of the two), and comparison with the value greater (A is bigger than B), less (A is smaller than B) or equal (they are the same). Use it when you need to pick the highest amount among several, compare the actual deal amount with the planned one, or build a conditional branch on the comparison result without nested Condition blocks. The comparison output is convenient to compare in the condition of the next step of the business process.
What input parameters does the robot accept?
| Parameter | Type | Required? | Default |
|---|---|---|---|
| Number A | string | yes | |
| Number B | string | yes |
What does the robot return?
| Parameter | Type |
|---|---|
| Greater value | string |
| Lesser value | string |
| Result: greater / less / equal | string |
Scenario: pick the larger of two amounts in a deal
- A deal enters the cost calculation stage
- The robot compares the list-price amount with the discounted amount
- The max field gets the greater value, comparison shows greater, less or equal