Menu

Calculation

The Calculation block does one sum with two values and keeps the result. Use it to work out a total for a payment, a number of repeats, or a value an If / Else block can check.

A Calculation block selected on the editor board, with its operator and operands on the right.
The block on the board, with its settings on the right.

What your respondent sees

Nothing. The block is invisible. Its result appears only through the blocks that use it, for example as the amount on a payment.

Connections

  • One input at the top and one output at the bottom.
  • Put it after the questions it reads. Its source list shows only earlier Number questions and other Calculation blocks.
  • Other blocks can then pick it: Payment (amount), Repeat (count), If / Else rules and other Calculation blocks.
  • A Calculation block can't depend on itself, directly or through other Calculation blocks.

How to add a Calculation block

  1. Click Calculation in the Add to form list, or hover a block, click the + below it and choose Add Arithmetic Block.
  2. Connect the block before it into the Calculation block, and the Calculation block to the next one.
  3. Click the block and choose an Arithmetic Operator.
  4. For Operand A and Operand B (the two numbers in the sum), choose a Source Type and fill in the value or source.
  5. Pick this block in the Payment, Repeat or If / Else block that needs the result.

Settings

SettingWhat it doesOptions / default
TitleThe block's name. It shows in the lists where you pick a Calculation block.Text. New blocks are named "Arithmetic Block".
Arithmetic OperatorThe sum to do with A and B.Add (+), Subtract (-), Multiply (×), Divide (÷), Minimum (smaller of A, B), Maximum (larger of A, B). Default Multiply. Dividing by 0 gives 0.
Operand A and Operand B - Source TypeWhether the value is typed in or read from earlier in the form.Two buttons: Static Value or Upstream block.
Static ValueA number you type.Number, such as 10. A new static value is 1.
Source BlockAn earlier Number question or Calculation block to read."Select source block…", or "No upstream blocks" until you connect one.

If a question is blank or isn't a number, it counts as 0. The result keeps all its decimals. A payment rounds to the paisa.

Example: total = tickets × ₹500

  1. Add a required Number question "How many tickets?".
  2. Add a Calculation block after it and set Arithmetic Operator to Multiply (×).
  3. Set Operand A to Upstream block, with Source Block "How many tickets?".
  4. Set Operand B to Static Value 500.
  5. In the Payment block, set Pricing Amount Type to Arithmetic Calculation Block and pick this block. Two tickets cost ₹1,000.

Counters and running totals inside a Repeat

Put a Calculation block inside a Repeat block's loop body and point one operand at another Calculation block. That block is then updated once on every pass. For example, set the operator to Add, Operand A to a "Total" Calculation block, and Operand B to the price question inside the loop. The total grows by each pass's price.

If you point at no other Calculation block in the loop, nothing else reads the block's result, and you see an error (see below).

Question
How many seats?
Calculation
Total = seats × ₹500
Payment
Workshop seat
Seats are multiplied by ₹500 and the result goes to Payment.

Common mistakes

MessageWhat it meansWhat to do
Arithmetic block arithmetic operator is not selected.No operator chosen.Choose one.
Arithmetic block operand A/B is missing its node reference.An operand is set to Upstream block but no source is chosen.Pick a Source Block.
Arithmetic block operand A/B is missing its numeric value.A static value is empty.Type a number.
Circular calculation dependency.Calculation blocks read each other in a circle.Break the circle.
"X" runs every loop pass but does nothing with the resultA Calculation block in a loop updates nothing and no one reads it.Point one operand at the Calculation block it should update, or use its result elsewhere.
Answer is used but optionalA question it reads isn't required.Click Make required.

Can't find what you need? Contact us