Calculate

The Calculate action node allows you to perform mathematical operations on flow variables.

You can use two types of mathematical operations:

  • Comparison: Variables are compared against each other as per the expression - if it matches, a "Yes" result is returned, if it doesn't match, a "No" result is returned.

  • Calculation: The result of the expression is calculated and stored under a session variable [[actionName:result]]. In other words, if you want to refer to the result of this calculation in another node, [[actionName:result]] is the variable name you should use. If successfully calculated, a "Yes" result is returned, else a "No" result is returned.

Examples

The table below describes examples of mathematical expressions you can define in Chat Flow. You can create expressions as simple or complex as required.

Description

Example

+ - / *

Standard math calculations (add, subtract, divide, multiply)

a+b, a-b, a/b, a*b

= > < >= <=

Standard comparison operators (equals to, greater than, less than, greater than or equals to, less than or equals to)

a=b, a>b, a<b, a>=b, a<=b

!=

Not equal to comparison operator

a!=b