How to use Field calculator to calculate complex calculations and populate desired result in any of the field?

How to use Field calculator to calculate complex calculations and populate desired result in any of the field?

Introduction

Managing calculations across multiple fields can be tricky in any CRM. Often, sales teams need to automate complex logic such as percentage commissions, conditional values, or aggregate metrics like averages and totals. To make this process easier, Kylas provides the Field Calculator App, which allows you to define formulae, apply mathematical and logical operators, and automatically populate results into CRM fields.

With the Field Calculator, you can go beyond simple arithmetic — it supports IF conditions, logical operators, percentage calculations, and aggregation functions (SUM, AVG, MIN, MAX, COUNT). This ensures that repetitive calculations are automated, error-free, and available directly inside your CRM workflows.

This article covers everything you need to know about using the Field Calculator in Kylas — from prerequisites, setup, and installation, to creating formulae, applying workflows, and exploring advanced use cases.


Table of Contents

  1. Prerequisites

  2. Steps to Install the Application

  3. How to Set Up a Calculation Formula

  4. How to Use the Formula in Workflows

  5. Advanced Formula Options

  6. Use Cases

  7. Benefits

  8. Conclusion


1. Prerequisites

Before you begin, ensure you have the following permissions and plan access:

  • Permissions:

    • Products and Services → Read / Read All permission

    • Related Entity permission enabled

  • Product Plan:

    • Available in Elevate plan


Steps for Using and Installing Field calculator


  1. Steps to Install the Application
    • Locate the Kylas Field Calculator app in the All-Apps menu under the Kylas Marketplace
    • Click on the app and then 'Install App' button
    • Login using the Kylas Sales details and then click on the 'Allow and Install'
    • After installation Sign-up for the app
    • Verify your email to login the app and enter the Kylas API key
    • Navigate to 'Installed Apps' and click on 'View Details' for the Kylas Field Calculator app.
  2. How to set up a Calculation Formulae:
    • Login to the Kylas Field Calculator app
    • Navigate to the Formulae tab and click on the 'Add Formula' button
    • Select the entity from the drop-down for which the calculation needs to be performed
    • Give a title/name to the group (You can include 1 or more formulae in a group)
    • Click on the '+ Add Formula-Based Relation' to set the calculation
    • Select a field from the 'Write Result to' drop-down into which the calculation result will be updated. Also, you can select the checkbox if you want to use values derived from previous formulae.
    • Enter/Type '$' in the '$add expression' to view/choose the number field for the calculation. You can also use multiple operators for calculation such as
      • +, -, / and *
      • Comparison operators: Greater Than (>), Less Than (<) Equals (=) in an IF condition [E.g. (if($Field1 >= 5, 3, 4) will return 4 when $Field1 is 2]
      • Percentage Calculation - ($Field1 * 10%) - $Field2
    • Add more fields or create another formula and then save the field relation for the calculation.
  3. How to Use the Set Formulae
    • Go to the Kylas Sales -> Automation -> Workflows -> Add a Workflow
    • Set-up workflow for the same entity used for formula setup.
    • In the action drop-down, select 'Marketplace' and then 'Calculate field values' from the next drop-down.
    • Select the formula from the drop-down to perform the calculation action when the business condition meets.
    • You can set/create a real time formula from the 'Create new' option available on the top and the system will automatically select the entity type based on workflow entity.
    • View all your performed calculation details under the logs tab along with the below details
      • Entity ID on which the calculation was performed.
      • Which formula was used
      • View the change details
      • Activity timestamp details
    • Look for a specific detail with the help of filter option.

    5. Advanced Formula Options

    The Field Calculator supports advanced logical and numerical operations:

    • Comparison Operators:

      • < (Less Than), > (Greater Than), <=, >=, != (Not Equal), = (Equal)

      • Example: if($Field1 >= 5, 3, 4) → returns 4 if $Field1 = 4

    • Logical Operators in IF:

      • AND, OR, XOR, NOT

      • Example: if(($Field1 > 5 AND $Field1 < 10), 7, 15) → returns 7 if $Field1 = 8

    • Aggregation Functions:

      • MAX($Field1, $Field2) → returns the larger value

      • MIN($Field1, $Field2) → returns the smaller value

      • COUNT(10, 15, 20) → returns 3

      • AVG(5, 10, 15) → returns 10

      • SUM(5, 10, 15, 20) → returns 55

    • Rounding Functions:

      • ROUND($Field1, 2) → rounds to 2 decimal places

      • ROUNDUP() and ROUNDDOWN() are also supported.


    6. Use Cases

    Here are some real-world scenarios where the Field Calculator can be applied:

    • Commission Calculation: (Deal Value * 10%) to auto-populate sales commission.

    • Discounted Price: ($Price - ($Price * $Discount%)).

    • Lead Scoring: Use IF conditions to assign scores based on lead attributes.

    • Stage-wise Deal Value Tracking: Aggregate deal values by stage for pipeline forecasting.

    • Target Achievement: if($ClosedDeals >= $Target, "Achieved", "Pending").

    • Expense vs Revenue Analysis: SUM($Revenue) - SUM($Expenses) for profitability insights.


    7. Benefits

    • Automation of Complex Calculations: Reduces manual effort and human error.

    • Real-Time Accuracy: Formulae run automatically via workflows.

    • Flexibility: Works across multiple entities (Leads, Deals, Products, etc.).

    • Scalability: Add multiple formulae to a group for layered calculations.

    • Transparency: View logs to track what formula was used and when.


    8. Conclusion

    The Kylas Field Calculator App empowers businesses to automate complex mathematical and logical operations directly within their CRM. From commission calculations and lead scoring to advanced conditional workflows, it provides flexibility and control without requiring coding.

    By integrating formulae with workflows, you ensure real-time execution and consistency across your sales processes. Whether you need simple arithmetic or multi-layered logic, the Field Calculator is a powerful tool to boost productivity, improve accuracy, and give your team actionable data at their fingertips.