This article explains how to use the Perform Math Operations action in HappyFox Workflows to calculate numeric values at runtime and pass the result to subsequent actions in the same workflow.
Applicable Plans: Available on all plans.
What it does
The Perform Math Operations action performs a single arithmetic operation — addition, subtraction, multiplication, or division — across two or more numeric values. Each value can be entered manually or populated dynamically using a merge field from the trigger or a previous workflow step. The action stores the calculated result as an output value that later actions can reference using merge fields.
Supported input types
The action accepts only numeric values. Any other input type causes the action to fail.
| Input | Supported |
|---|---|
Integers (for example, 10, 250, -5) |
✔️ Yes |
Decimal values (for example, 10.5, 99.99, -2.75) |
✔️ Yes |
Negative numbers (for example, -10, -50.5) |
✔️ Yes |
| Empty values | ✖️ No |
| Whitespace | ✖️ No |
Alphabetic characters (for example, abc, twenty) |
✖️ No |
Alphanumeric values (for example, 10abc) |
✖️ No |
Note: Confirm that every configured value and merge field resolves to a valid number when the workflow runs. An invalid or empty input causes the action to fail.
Available operations
- Add — Adds all provided values together, in order. Example: 10 + 5 + 2 = 17.
- Subtract — Subtracts each subsequent value from the first value. Example: 20 − 5 − 3 = 12.
- Multiply — Multiplies all provided values together, in order. Example: 10 × 5 = 50.
- Divide — Divides the first value by each subsequent value, in order. Example: 100 ÷ 4 = 25.
Note: The selected operation applies continuously across every value you add, not just the first two. For example, adding five values under Add calculates
a + b + c + d + e; five values under Subtract calculatesa − b − c − d − e; five values under Multiply calculatesa × b × c × d × e; and five values under Divide calculatesa ÷ b ÷ c ÷ d ÷ e. There is no limit of two values — add as many as the calculation requires.
Note: For Subtract and Divide, the first value is the base. Every value after it is subtracted from, or divided into, the running total — so the order in which you enter values determines the result.
How to use it
- Open the workflow you want to edit in HappyFox Workflows.
- Click Add Action at the point in the workflow where you want to perform the calculation.
- Under In-built workflow actions, select Perform Math Operations.
- In the Operation dropdown, select Add, Subtract, Multiply, or Divide.
- In the Values section, enter the first number. To use a dynamic value instead, click Insert Merge Fields and select the field.
- Enter the second number, or use Insert Merge Fields to select a field.
- Optionally, add further values and repeat step 6 for each one.
Note: At least two values are required. The action cannot be saved with fewer than two values populated.
- Click Save & Test to validate the action against a test ticket.
- Review the test output to confirm the correct operation ran, the correct values were used, and any merge fields resolved successfully.
The Perform Math Operations configuration panel, showing the Operation dropdown set to Add and two number fields populated.
Example configuration
| Field | Value |
|---|---|
| Operation | Multiply |
| Value 1 | [Item Price] |
| Value 2 | [Quantity] |
If Item Price is 25 and Quantity is 4, the output is 100.
Using the result in subsequent actions
After the action runs, the calculated value is available as Result to any later step in the workflow. To reference it, click Insert Merge Fields in that step's configuration and select Result from the Perform Math Operations step.
Common use cases include calculating an order total by multiplying quantity and unit price, applying a discount before sending data to another system, adding tax to an invoice total, and incrementing a counter field to track escalations.
Next Steps
Your Perform Math Operations action is now configured, and its output is available as a variable in subsequent workflow steps.