Calculate a value

Use the Calculate a value action A tool for building the processes, logic, and direction within workflows. Actions are the steps the workflow performs to complete a process. to perform a simple mathematical calculation with two values and an operator. The calculated value variable is output as a variable, which you can use throughout your workflow.

For example, let's say you have a sales process that allows for a discount to be applied to a billing amount. The Calculate a value action takes a dollar value e.g. $1000 and a discount value e.g. 10%, and uses both values in a multiplication calculation to output a final discounted billing amount as a variable of 900:

  • 1000 x 0.90 = 900

You can use the output variable throughout your workflow in a variety of actions. For example, add the discounted amount to the body of an approval task email sent by an Assign a task to multiple users action.

The functionality of this action has been enhanced with the switch to the new workflow engine. For more information about the workflow engine, see Workflow engine.

Previous behavior New behavior

Available operators:

  • Add

  • Subtract

  • Multiply

  • Divide

With the new Mod operator also available, this action now has the following operators:

  • Add

  • Subtract

  • Multiply

  • Divide

  • Mod

If the Mod operator is selected, the output value is the remainder after the Number 1 value is divided by the Number 2 value. 

For example, if Number 1 is 27 and Number 2 is 7, the result is 6.

Configure the Calculate a value action

  1. Add the action to the workflow and open the action configuration panel. For more information, see Add an action to the workflow.

  2. In the Number 1 field, type an integer value.
  3. Select an Operator.
  4. In the Number 2 field, type an integer value.
  5. Select a variable for Store result.

Calculate a value action fields and settings

Field

Description

Variable types

Number 1 The first value in the calculation. Decimal, Integer
Operator

The type of calculation operation performed on the Number 1 and Number 2 values.

Select one of these options:

  • Add
  • Subtract
  • Multiply
  • Divide
  • Mod

Note: If the Mod operator is selected, the output value is the remainder after the Number 1 value is divided by the Number 2 value. For example, if Number 1 is 27 and Number 2 is 7, the result is 6.

(n/a)
Number 2 The second value in the calculation. Decimal, Integer
Store result The variable which stores the result of the calculation. Decimal, Integer