Skip to main content
Evaluate Block Screenshot

Overview

The Evaluate Block performs a mathematical operation on the input values and outputs the result. It supports a variety of operations including addition, subtraction, multiplication, division, exponentiation, modulus, absolute value, and negation.

Inputs

TitleData TypeDescriptionDefault ValueNotes
AnumberThe first operand for the operation.(Required)The input will be coerced into a number if it is not a number.
BnumberThe second operand for the operation.(Required for binary operators)The input will be coerced into a number if it is not a number.

Example 1: Performing a simple addition

  1. Create an Evaluate Block and set the Operation to +.
  2. Create two Number blocks, set their values to 2 and 3 respectively.
  3. Connect the Number blocks to the A and B inputs of the Evaluate Block.
  4. Run the flow. The output of the Evaluate Block should be 5.
Evaluate Block Example 1

Error Handling

If the operation fails (for example, if you try to divide by zero), the Evaluate block will error.

FAQ

Q: What if I want to perform a different operation based on the input? A: You can use the Operation input port to dynamically change the operation based on the input. The input will be coerced into a string and must match one of the supported operations.

See Also