How to run calculations in a workflow with the Math Operation action
In the workflow, click + and add Math Operation. Choose the number or date field to calculate, the operation (add, subtract, multiply, divide, or add/subtract days, months and years on a date), the value, and the field where the result is stored. Save the action and publish.
Updated on
Before you start
- Create the custom fields you'll use under Settings › Custom Fields: a number or monetary field for value calculations, a date field for date calculations.
- Decide what you want to calculate and where to store the result (it can be the same field or a different one).
Where to find it
Automation › Workflows › (open the workflow) › + › Math Operation
Step by step
Number calculation (e.g. lead score)
- Open the workflow and click the + at the point where the calculation should happen.
- Choose Math Operation.
- In Select Field, pick the starting number field (e.g. the custom field "Score"). You can also use data coming from the trigger.
- In Operation, choose add, subtract, multiply or divide.
- In Value, type the number (e.g.
10) or pick another number field. - In Update Field, choose where to store the result: a standard field, a custom field or a custom value.
- Click Save Action.
Date calculation (e.g. renewal date)
- Add Math Operation and, in Select Field, pick a date field (e.g. "Start date") or the current date.
- In Operation, choose add or subtract days, months or years.
- In Value, type the amount (e.g.
1year). - In Update Field, choose the date field that will hold the result (e.g. "Renewal date").
- Click Save Action and publish the workflow.
Tips
- For lead scoring, use a workflow with several triggers (form submitted, link clicked, call answered…) and, on each one, add points to the same field. Then an If/Else with "Score greater than X" separates the hot leads.
- The result can be used right away in an If/Else condition, in a message (dynamic field) or in a wait-until-date action.
- To subtract, you can also add a negative value.
Common problems
- The field doesn't show up in the list to calculate → The custom field isn't a number, monetary or date type. Create a field of the right type under Settings › Custom Fields.
- The result is empty or wrong → The starting field was empty on the contact. Fill it first (for example, with the Update Contact Field action set to an initial value of
0). - Date addition isn't in the options → For dates you can only add or subtract days, months or years; multiply and divide are for numbers only.
- I want two calculations in a row → Each action performs one calculation. Add two Math Operation actions, one after the other.
Frequently asked questions
Can I use the result in an If/Else condition?
Yes. After the Math Operation, add an If/Else that compares the updated field (e.g. "Score is greater than 50").
Can I calculate from today's date?
Yes. In Select Field choose the current date and add or subtract the period you need.
Was this helpful?
Thanks for your feedback.
