08-11-2025 06:32 AM - edited 08-11-2025 08:47 AM
Contents of this Article
Formula Fields allow you to calculate new data, typically by creating a formula that references or alters existing Marketing Data Fields or Signals. Using formulas that work similar to Excel, you can use Invoca or custom-written functions to calculate new data to enrich dashboards and reports.
Note: Invoca's formula-based functionality is currently limited to categorizing Marketing Channel performance. This is just the first step—we're exploring additional formula-based features to bring you even more functionality.
Formula Fields are a new feature that will be rolled out gradually. Initially, interacting with Formula Fields will be limited to editing Marketing Data Fields where Invoca has already attached a default formula. For most, this means you'll be able to edit the formula attached to the Marketing Channel field.
Note: Look for the (f) icon on your Marketing Data Dictionary page to identify fields with an attached formula.
Note: Formulas are processed on a per-call basis, applying to each row of Invoca data individually. This feature does not support multi-row or aggregate calculations (e.g., adding totals across multiple calls).
To edit a Formula Field, follow the following steps.
Note: You must be a Super User to edit a Marketing Data Field.
Navigate to Settings:
From the main menu, select Settings, then Marketing Data.
Select Field for Editing:
Locate the Marketing Data Field you wish to edit and click its Edit icon.
Note: Initially you can only edit fields that Invoca has added a formula to. These fields are indicated by an (f) icon in the Marketing Data Dictionary.
Access Formula Section:
On the Edit Marketing Data Field page, scroll down to the Formula (optional) section.
Open Formula Editor:
Click the Edit and Preview button. This will open a new modal window.
Adjust Formula:
In the Formula input box, make your desired changes to the formula.
Preview Changes:
Click the Refresh button to see how your changes impact the data. A summary of the changes will appear in the Preview with call data table.
Apply or Cancel Changes:
To Apply:
If you are satisfied with your edits, click Apply to save the new formula and return to the Edit Marketing Data Field page.
Note: Formula changes will not be fully saved until you click Save on the Edit Marketing Data Field page.
To Cancel:
If you are not satisfied, click Cancel to discard your edits. This will return you to the Edit Marketing Data Field page, and your previously saved formula will remain.
Editing an Invoca formula is very similar to editing a formula in Microsoft Excel. Both platforms utilize a structured syntax to perform calculations and manipulate data. Just like in Excel, you'll use functions, operators, and references to define your desired output.
To help you write effective formulas, it's important to understand the different types of data you'll be working with.
Invoca Feature |
Data Type |
Description |
Example Formula |
Marketing Data Fields |
Short Text, Category* |
Referenced by Partner (API) Name. Defaults to "" (empty string) if no value present. |
utm_medium |
Invoca Reporting Fields |
Short Text, Category* |
Referenced by Invoca Reporting Field Name. Defaults to "" (empty string) if no value present. |
invoca.media_type |
Signals |
Boolean |
Referenced by Name. Use backticks (`) around names that contain spaces or any punctuation other than an underscore (_) or period (.). Defaults to False if no value present. |
`Answered by Agent` |
* Note: Long Text fields (e.g., URLs) are not supported in Formula Fields at this time.
Name | Description |
Example
|
ABS | Returns the absolute value of a number (the positive equivalent). |
=ABS(call_duration)
|
AND | Checks whether all arguments are TRUE, and returns TRUE if all arguments are TRUE. |
=AND(call_duration > 60, call_result = "Conversion")
|
AVERAGE | Returns the average (arithmetic mean) of its arguments. |
=AVERAGE(call_duration, call_ring_time)
|
CEILING | Rounds a number up to the nearest integer or to the nearest multiple of significance. |
=CEILING(call_cost_per_call, 1)
|
CONCAT | Joins two or more text strings into one text string. |
=CONCAT(campaign_name, " - ", call_result)
|
FLOOR | Rounds a number down to the nearest integer or to the nearest multiple of significance. |
=FLOOR(call_cost_per_call, 1)
|
IF | Checks whether a condition is met, and returns one value if TRUE, and another value if FALSE. |
=IF(call_result = "Conversion", "Converted", "Not Converted")
|
IFS | Checks whether one or more conditions are met and returns a value that corresponds to the first TRUE condition. |
=IFS(call_duration < 30, "Short", call_duration < 120, "Medium", call_duration >= 120, "Long")
|
LEFT | Returns the first character or characters from a text string, based on the number of characters you specify. |
=LEFT(traffic_source_name, 5)
|
LEN | Returns the number of characters in a text string. |
=LEN(call_caller_id)
|
NOT | Reverses the logic of its argument. |
=NOT(call_result = "Spam")
|
OR | Checks whether any of the arguments are TRUE, and returns TRUE if any argument is TRUE. |
=OR(ad_campaign_name = "Summer Sale", ad_campaign_name = "Spring_Promo")
|
REGEXTEST | Tests if a text string matches a regular expression pattern. Returns TRUE if the pattern is found within the text, and FALSE otherwise. Allows control over case sensitivity. |
=REGEXTEST(landing_page_url, ".*invoca\\.com/.*", 0)
|
RIGHT | Returns the last character or characters from a text string, based on the number of characters you specify. |
=RIGHT(campaign_name, 4)
|
ROUND | Rounds a number to a specified number of digits. |
=ROUND(call_cost_per_call, 2)
|
SUM | Calculates the sum of a series of numbers or cells in an Excel-like formula. |
=SUM(call_cost_per_call, call_credit_amount)
|
SWITCH | Compares an expression to a list of values and returns the result corresponding to the first match. If no match is found, an optional default value can be returned. |
=SWITCH(call_result, "Conversion", "Success", "No Answer", "Missed", "Spam", "Junk", "Other")
|
Name | Description |
Example
|
= | Equal to |
=call_result = "Conversion"
|
> | Greater than |
=call_duration > 120 (e.g., for calls over 2 minutes)
|
< | Less than |
=call_ring_time < 10
|
>= | Greater than or equal to |
=call_revenue >= 50
|
<= | Less than or equal to |
=call_cost <= 100
|
<> | Not equal to |
=call_type <> "Spam"
|
+ | Addition |
=call_cost + call_estimated_revenue
|
- | Subtraction |
=call_duration - call_ring_time
|
* | Multiplication |
=call_cost * 1.25 (e.g., to account for a margin)
|
/ | Division |
=call_revenue / call_duration (revenue per second)
|
% | Percent |
=call_cost * 15% (e.g., to calculate a commission)
|
Adding a New Marketing Channel
Note: Visit this learning resource in Invoca Academy for best practices on adding a new marketing channel.
In this example, you have a Marketing Data Field named "Marketing Channel". The field has a formula that uses UTM parameter data to assign a marketing channel value. You would like to update the formula to account for a new type of marketing spend (e.g., "AI Search").
Note: You must be a Super User to edit a Marketing Data Field.
=IFS(
REGEXTEST(CONCAT(utm_medium, ";", utm_source), "video"), "Video",
REGEXTEST(CONCAT(utm_medium, ";", utm_source), "display"), "Display",
REGEXTEST(CONCAT(utm_medium, ";", utm_source), "ai( )?search"), "AI Search",
...
TRIM(CONCAT(utm_medium, utm_source)) = "", "No UTM parameter data",
TRUE, "Uncategorized Channel"
)
Review your uncategorized calls to find opportunities to map new channels, like AI Search.
Formula Fields in Invoca are a powerful new way to create custom data. This data is calculated on-the-fly, right within the Lead Conversion Dashboard, by applying your defined formulas to existing call data fields.
Formula Fields can be used with Signals and most Marketing Data Fields. Specifically, you can use Short Text and Category Marketing Data Fields.
Note: Long Text fields cannot be referenced in a Formula Field.
To confirm the data type of any Marketing Data Field, please consult the Marketing Data Dictionary.
In your marketing channel categorization, these two groups indicate different issues:
What you can do:
Understanding this distinction helps you troubleshoot. "No UTM parameter data" highlights potential tracking gaps, while "Uncategorized Channel" indicates areas where your channel categorization rules need to be expanded or adjusted.
Formula Field data is currently accessible only within the Lead Conversion Dashboard. It will not appear in other dashboards or reports at this time.
Invoca's default Marketing Channel formula uses UTM parameter data to assign calls to industry-standard marketing channels.
# Formula categorizes calls into marketing channels based on UTM parameter data.
# To customize or add channels, see our help documentation. version: 1
=IFS(
REGEXTEST(CONCAT(utm_medium, "|", utm_source), "video"), "Video",
REGEXTEST(CONCAT(utm_medium, "|", utm_source), "display"), "Display",
REGEXTEST(CONCAT(utm_medium, "|", utm_source), "referral"), "Referral",
REGEXTEST(CONCAT(utm_medium, "|", utm_source), "affiliate"), "Affiliate",
REGEXTEST(CONCAT(utm_medium, "|", utm_source), "email"), "Email",
REGEXTEST(CONCAT(utm_medium, "|", utm_source), "listing|gmb|google( )?business"), "Listings",
REGEXTEST(CONCAT(utm_medium, "|", utm_source), "billboard"), "Billboard",
REGEXTEST(CONCAT(utm_medium, "|", utm_source), "radio"), "Radio",
REGEXTEST(CONCAT(utm_medium, "|", utm_source), "paid( )?social"), "Paid Social",
REGEXTEST(CONCAT(utm_medium, "|", utm_source), "cpc|paid|ggl|ppc"), "Paid Search",
REGEXTEST(CONCAT(utm_medium, "|", utm_source), "gce|call( )?ext"), "Call Extensions",
REGEXTEST(CONCAT(utm_medium, "|", utm_source), "organic( )?social"), "Organic Social",
REGEXTEST(CONCAT(utm_medium, "|", utm_source), "organic"), "Organic Search",
REGEXTEST(CONCAT(utm_medium, "|", utm_source), "direct"), "Direct",
REGEXTEST(CONCAT(utm_medium, "|", utm_source), "print|newspaper|magazine|flyer|brochure"), "Print",
REGEXTEST(CONCAT(utm_medium, "|", utm_source), "tv|television"), "TV",
TRIM(CONCAT(utm_medium, utm_source)) = "", "No UTM parameter data",
TRUE, "Uncategorized Channel"
)