Action - Math Operation

Modified on: Tue, 15 Oct, 2024 at 7:55 AM

The Math Operation action in workflows allows users to perform calculations on numbers and dates, enabling automated lead scoring and scheduling. This feature supports custom variables and fields, offering flexibility for different business needs and seamless integration with If/Else conditions for lead management.



Covered in this Article:

What is the Math Operation Action in Workflows?

Some Excellent Usage Cases for the Math Operation and How it solves some real business problems:

Benefits of the Math Function:


How does it work?

Five Usage Cases for Combining Math Operations with other actions and Conditions:

Short Summary:


Numeric / Monetary Field Types

Numeric Field:

Monetary Field:


Date Field Type

Date Field:

Current Date field


Applying Negative Values to Math Operations:

Monetary Field Constraints:

Numeric Field Constraints:


FAQs

Can I perform multiple math operations in a single workflow step?

How do I handle rounding errors or decimal precision when performing math operations?

Can I perform math operations on custom date fields?

Are there any limitations on my range of values in math operations?

Can I use the result of a math operation in an If/Else condition?

Other Usage Cases for If/else conditions with Math Operations:

Can math operations be performed using data from external sources, such as APIs?

Can I use Math Operation actions in combination with other workflow actions and triggers?





What is the Math Operation Action in Workflows?

The Math Operation action in workflows is a powerful tool that automates calculations and manipulations on numeric and date fields, streamlining business processes and decision-making. For example, imagine a gym that wants to automatically update its members' renewal dates by adding one year to its current membership expiration date. With the Math Operation action, the gym can effortlessly set up a workflow to perform this calculation, saving time and ensuring accuracy while focusing on providing excellent service to its members.


Some Excellent Usage Cases for the Math Operation and How it solves some real business problems:


Gym Membership Renewal: Automatically update membership renewal dates by adding one year to the current expiration date, ensuring timely reminders for clients and improved retention.


Loan Amortization: Calculate the remaining balance of a loan after each payment, helping businesses keep track of their financial health.


Sales Commissions: Calculate commission amounts for sales representatives based on custom commission rates and achieved sales targets, ensuring fair and accurate compensation.


Lead Scoring: Increment lead scores each time a lead interacts with a business, such as making a phone call or visiting the website, to gauge their interest and prioritize follow-up efforts.


Project Deadlines: Add or subtract days from project start dates to calculate deadlines and automate reminder notifications for team members.


Subscription Expirations: Calculate subscription expiration dates for a software service by adding the subscription duration to the activation date, enabling timely renewal reminders.


Customer Lifetime Value: Multiply average purchase value by the frequency of purchases to estimate a customer's lifetime value, helping businesses identify high-value clients and optimize marketing efforts.


Inventory Management: Subtract sold items from the total inventory to track stock levels and automate reordering processes.


Warranty Tracking: Add warranty duration to the product purchase date to determine the end of warranty coverage and facilitate customer support.


Age Verification: Subtract a customer's birthdate from the current date to verify their age for age-restricted products or services.


Discounted Pricing: Multiply the original price by a discount percentage to calculate discounted prices during promotional campaigns.


Sales Tax Calculation: Multiply the subtotal by the applicable tax rate to determine the final price, ensuring accurate invoicing.


Employee Performance Metrics: Calculate performance metrics, such as sales quotas or customer satisfaction scores, to evaluate employee performance and identify areas for improvement.


Rental Property Management: Calculate late fees for overdue rent by multiplying the daily late fee rate by the days past due, encouraging timely payments.


Milestone Bonuses: Calculate milestone bonuses for employees by multiplying their base salary by a predetermined bonus percentage, rewarding hard work and dedication.


Product Profit Margin: Subtract the cost of goods sold from the selling price and divide by the selling price to calculate profit margins, enabling informed pricing decisions.


Customer Segmentation: Calculate the average time between purchases to segment customers into groups like "frequent buyers" or "occasional shoppers," optimizing marketing campaigns.


Event Countdown: Subtract the current date from the event date to display a countdown timer for upcoming events or promotions.


Budget Tracking: Subtract expenses from the total budget to monitor remaining funds and ensure responsible spending.


Interest Calculation: Calculate interest on savings accounts or loans by multiplying the principal balance by the interest rate, providing a clear overview of financial growth or debt repayment.


Benefits of the Math Function:

The benefits of the Math Operation feature in workflows include:


Automation: Streamline repetitive and time-consuming calculations, freeing time for more valuable tasks and improving overall productivity.


Accuracy: Minimize human error in calculations, ensuring precise results and reliable data for decision-making.


Customization: Perform mathematical operations using custom fields and variables, tailoring calculations to suit specific business needs and scenarios.


Improved Decision-Making: Gain valuable insights from data analysis, enabling better informed strategic decisions and optimizing business performance.


Enhanced Lead Management: Use calculated lead scores and other metrics in If/Else conditions to route lead through sales funnels more effectively, improving conversion rates and sales outcomes.


Time-based Scheduling: Automate time-sensitive processes and task scheduling using date-based calculations, ensuring timely reminders and follow-ups.


Flexibility: Perform various calculations, including addition, subtraction, multiplication, and division, on both numeric and date fields, accommodating diverse business requirements.


Integration: Seamlessly integrate with other workflow actions and conditions, such as If/Else, to create more dynamic and robust business processes.


Scalability: Efficiently handle growing volumes of data and calculations as a business expands without manual intervention or additional resources.


Cost Savings: Reduce manual labor costs associated with performing calculations and maintaining data accuracy, ultimately improving the bottom line.


How does it work?


The Math Operation feature in workflows works by following these steps:

  1. Create or select a workflow: Begin by creating a new workflow or selecting an existing one where you want to apply the Math Operation action.

  2. Add the Math Operation action: In the workflow builder, click "Add Action" and select the "Math Operation" action from the list of available actions.


  3. Choose the field to update: Select the numeric or date field you want to update with the result of the math operation. Depending on your requirements, this field can be a standard or custom field.

  4. Select the operation: Choose the mathematical operation you want to perform on the selected field.


    You can choose from addition, subtraction, multiplication, or division for numeric fields,



    And you can choose the addition or subtraction of days, months, or years for date fields.
  5. You can add any values from the trigger and use them in the field "Select Field"
  6. The numeric and trigger fields will also be available in the 'Value" field in the operation section.






7. Input the operator. Enter the value or custom field to use as the operator in the math operation. For example, if you want to add 10 to a numeric field, input "10". If you use a custom field, you can insert it using the appropriate merge tags or custom field syntax.


8. Update Field - Select the field that you would want to update. In the Update field dropdown you will find "Standard Fields", "Custom Fields" and "Custom Values" to select from.




9. Save the action: Click "Save" to apply the Math Operation action to the workflow.

10. Activate the workflow: Once you have configured the Math Operation action and any other required actions and conditions, Publish the workflow. The math operation will execute automatically whenever the workflow is triggered, updating the specified field according to the configured operation.

11. Combine with other actions and conditions: Optionally, you can integrate the Math Operation action with other actions, such as sending emails or updating fields, and conditions, like If/Else, to create more complex workflows tailored to your business needs. Read Five Usage cases for that below:


Five Usage Cases for Combining Math Operations with other actions and Conditions:

Lead Prioritization and Follow-up:

Use the Math Operation action to increment a lead's score based on their interactions with your business. Combine this with If/Else conditions to segment leads into different categories (e.g., hot, warm, and cold leads). Trigger different follow-up actions, such as sending targeted email campaigns or assigning high-priority leads to sales representatives for immediate contact.


Subscription Renewal Reminders: Use the Math Operation action to calculate the renewal date of a subscription by adding the subscription duration to the start date. Combine this with an If/Else condition to check if the renewal date is approaching (e.g., within the next two weeks). If true, trigger reminder emails to encourage customers to renew their subscriptions.

Sales Commission Calculation and Notification: Utilize the Math Operation action to calculate sales commissions for your sales team based on their performance metrics (e.g., revenue generated or deals closed). Combine this with an If/Else condition to check if the commission amount exceeds a certain threshold, indicating exceptional performance. If valid, email the sales representative congratulating them on their achievements and informing them of their commission payout.

Project Deadline Tracking: Use the Math Operation action to calculate project deadlines by adding the project duration to the start date. Combine this with If/Else conditions to check if the deadline is approaching (e.g., within the next week) or the project is overdue. Depending on the outcome, trigger actions such as sending reminder emails to the project team or escalating the issue to a manager for intervention.

Customer Loyalty Program: Implement the Math Operation action to update customers' loyalty points based on their purchases or interactions with your business. Combine this with If/Else conditions to check if the customer has reached a specific points threshold, making them eligible for rewards or special offers. If the condition is met, send an email notifying the customer of their reward and encouraging them to redeem it.


Short Summary:

  1. Select field - select any Numeric / Monetary / Date field as an Input
  2. Operations - select an operation and enter respective values
  3. Update field - choose any field to update it with the output value


Please Note:

- Only Numeric, Monetary and Date field types are supported.
- The Select field and Update Field can be same or different but it has to be of same field type.
- If the output value is negative then it will be replaced as zero.



Numeric / Monetary Field Types

Numeric and monetary fields are two types of custom fields in workflows that are designed to store numerical values. They can hold and manipulate quantitative data within a workflow, such as lead scores, sales figures, or financial data. Here are some details about these field types:


Numeric Field:

Purpose: Numeric fields are designed to store whole numbers or decimal values, such as counts, quantities, percentages, or ratios.

Data Format: Numeric fields can accept both positive and negative values and decimal values with varying precision, depending on the system's configuration.

Use Cases: Numeric fields can store data like lead scores, product quantities, customer satisfaction ratings, or conversion rates. 

Monetary Field:

Purpose: Monetary fields are designed to store currency values, representing financial data such as prices, costs, revenues, or commissions.

Data Format: Monetary fields store numeric values with a designated currency symbol (e.g., USD, EUR, GBP) and typically have a fixed precision to represent cents or smaller units of the currency. They can also handle both positive and negative values.

Use Cases: Monetary fields can store data like product prices, transaction amounts, sales revenues, or employee salaries.




Both numeric and monetary fields can be used in Math Operation actions within workflows to perform addition, subtraction, multiplication, or division calculations.

These field types can be combined with other actions and conditions, such as If/Else or sending emails, to create complex, data-driven workflows that automate various business processes and decision-making tasks.



Date Field Type

In workflows, the Math Operation action can also be applied to date fields, allowing you to manipulate and calculate dates by adding or subtracting specific time units. This feature helps automate time-sensitive tasks and schedules based on dynamic dates. schedules


Here are some details about the date field types and their supported math operations:


Date Field:

Purpose: Date fields store dates and timestamps to represent events, deadlines, or milestones in a workflow.

Data Format: Date fields typically store information in a standardized format like YYYY-MM-DD or include time information (e.g., YYYY-MM-DD HH:MM: SS). They can also be displayed according to different time zones or locale-specific formats.

Supported Math Operations for Date Fields:


Add/Subtract Days:

Description: Add or subtract a specific number of days to/from a date field.

Use Cases: Calculate due dates for tasks or projects, determine follow-up dates for customer interactions, or compute the end date of a trial period based on the start date.


Add/Subtract Months:

Description: Add or subtract a specific number of months to/from a date field.

Use Cases: Calculate the next billing date for a subscription service, compute the date for a recurring monthly event, or determine the end date of a lease or contract.



Add/Subtract Years:

Description: Add or subtract a specific number of years to/from a date field.

Use Cases: Calculate the renewal date for an annual membership or license, and determine the date of a milestone, anniversary, or project future financial data based on historical trends.

Integrating math operations with date fields allows you to create dynamic, time-sensitive workflows that automatically adapt to changing dates and schedules. This can help streamline your business processes, ensure timely actions and reminders, and improve efficiency.




Current Date field

In workflows, the Math Operation action can also be applied to the current date, enabling you to perform calculations based on the current date and time. This feature can be handy for creating dynamic and time-sensitive workflows that react to the current date or time in relation to stored date fields. 


Here are some details about the current date field type and the math operations that can be performed on it:


Purpose: The current date field represents the current date and time according to the timezone of your sub-account. It can be used to compare and calculate dates about the present moment.

Data Format: The current date field typically stores information in a standardized format like YYYY-MM-DD or includes time information (e.g., YYYY-MM-DD HH:MM: SS). It can also be displayed according to different time zones or locale-specific formats.

Supported Math Operations for Current Date Field:



Add/Subtract Days:

Description: Add or subtract a specific number of days to/from the current date.

Use Cases: Calculate deadlines or follow-up dates based on the current date, determine the end date of a trial period, or compute the date for a future task or event.



Add/Subtract Months:

Description: Add or subtract a specific number of months to/from the current date.

Use Cases: Calculate the next billing date for a subscription service starting from the current date, compute the date for a recurring monthly event, or determine the end date of a lease or contract about the present moment.



Add/Subtract Years:

Description: Add or subtract a specific number of years to/from the current date.

Use Cases: Calculate the renewal date for an annual membership or license starting from the current date, determine the date of a future milestone or anniversary, or project future financial data based on historical trends and the current date.

By leveraging math operations on the current date field, you can create workflows that are adaptable and responsive to the present moment. This enables you to automate time-sensitive tasks, generate timely reminders, and improve the efficiency and effectiveness of your business processes.









Applying Negative Values to Math Operations:

Applying these constraints when performing Math Operations within workflows can be important based on the specific characteristics of monetary and numeric fields. Here are some examples of where these constraints could apply:


Please Note:

Negative values are not supported with Date or Current Date fields.



Monetary Field Constraints:

Use Case: Calculating discounts for a product or service. If the discount applied results in a negative value, the system should update the final price to 0 instead of a negative number, ensuring customers do not get charged a negative amount.

Solution: When performing Math Operations on monetary fields, it's essential to ensure that any subtraction operation that could result in a negative value is checked with an If/Else condition. If the result is negative, update the monetary field to 0.


Numeric Field Constraints:

Use Case: Calculating the net profit or loss for a business. In this case, the numeric field can store positive and negative values, representing profit or loss.

Solution: When performing Math Operations on numeric fields, one can directly add or subtract values without additional constraints, as negative values are allowed.

Using If/Else conditions and other actions to ensure the constraints are respected can benefit workflows. For example, if a Math Operation on a monetary field results in a negative value, an If/Else condition can be used to check the result and set the value to 0 if necessary, thus maintaining the constraint for monetary fields.




FAQs

Can I perform multiple math operations in a single workflow step?

Answer: No, each Math Operation action in a workflow allows you to perform a single math operation simultaneously. However, you can add multiple Math Operation actions in sequence within the same workflow to perform more complex calculations.


How do I handle rounding errors or decimal precision when performing math operations?

Answer: Most systems automatically handle decimal precision when performing math operations. However, if you need more control over rounding, consider adding custom logic or rounding functions in your workflow to ensure the desired level of precision.


Can I perform math operations on custom date fields?

Answer: Yes, you can perform math operations on custom date fields. This allows you to add or subtract days, months, or years to/from custom date fields, making it easy to automate time-based calculations and scheduling tasks tailored to your business needs.


Are there any limitations on my range of values in math operations?

Answer: The range of values you can use in math operations depends on the field type and the system's capabilities. For monetary fields, the minimum value is 0, whereas numeric fields can store both positive and negative values.


Can I use the result of a math operation in an If/Else condition?

Answer: Absolutely! You can use the result of a Math Operation action as a condition in an If/Else action to create dynamic workflows that route leads or perform specific actions based on the calculated values. For example:

We can use the lead scores you calculated in If/Else conditions to route leads to different paths based on specific conditions. 


This allows you to tailor the lead's journey through the sales funnel based on their level of interest in the business, as determined by their lead score.

Other Usage Cases for If/else conditions with Math Operations:

Renewal reminders: Subtract the current date from the subscription renewal date, and if the difference is less than or equal to a specific number of days (e.g., 14), send a renewal reminder email to the customer.


Sales commission calculations: Calculate the commission for a salesperson using Math Operations based on their sales revenue. If the commission amount exceeds a certain threshold, assign them to a high-performing group and send them a congratulatory email.


Time-sensitive promotions: Add a specific number of days to the current date. If the resulting date falls within a promotional period, offer customers a special discount or incentive.


Customer segmentation based on spending: Calculate the total spending of a customer using Math Operations. If the spending exceeds a certain threshold, classify them as high-value customers and send targeted offers.


Email campaign performance: Calculate an email campaign's open rate and click-through rate. If these metrics surpass specific benchmarks, trigger a follow-up campaign for engaged subscribers.


Project deadline monitoring: Subtract the current date from the project deadline, and if the difference is less than or equal to a specific number of days, send a reminder to the team members to complete their tasks.


Performance-based bonuses: Calculate an employee's performance score using Math Operations based on their achievements. If their score exceeds a predefined threshold, award them a bonus and congratulate them.


Inventory management: Calculate the remaining stock of a product by subtracting the sold quantity from the initial stock. If the remaining stock falls below a specific level, trigger a reorder or notify the purchasing department.



Can math operations be performed using data from external sources, such as APIs?

Answer: While the primary focus of Math Operation actions in workflows is on built-in numeric and date fields, some systems may allow you to incorporate data from external sources using custom fields or integrations. This enables you to perform calculations using data from external APIs or other systems.


Can I use Math Operation actions in combination with other workflow actions and triggers?

Answer: Yes, Math Operation actions can be combined with other actions, triggers, and conditions in your workflows. This allows you to create more complex and tailored business processes that automate calculations, data manipulation, and decision-making based on your needs.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article