Skip to main content
Formula fields automatically compute values based on expressions you define. They update whenever referenced fields change, so they always reflect current data. Example use cases:
  • Calculate days until renewal from a date field
  • Sum ARR across all related opportunities
  • Pull the account owner’s email from a related entity
  • Compute a weighted health score from multiple factors
  • Derive a contract value from unit price and quantity

Creating a Formula Field

You need admin access to create formula fields. The Object Manager is only available to users with the admin role.
  1. Navigate to Admin > Settings > Object Manager
  2. Select the entity tab (Accounts, People, Opportunities, etc.)
  3. Click + Create Field
  4. Enter a field name and select a field type that supports formulas (Text, Number, Date, Boolean, Currency, etc.)
  5. Check This is a formula field
  6. Click Save — the formula editor opens automatically

Formula Types

The formula editor supports four formula types. Select the one that fits your use case.

Equation

Write a custom expression combining fields, functions, and operators. This is the most flexible formula type.
Use Equation when you need custom logic — conditional calculations, arithmetic across fields, or text formatting. Examples: weighted scores, tier classifications, concatenated labels.
How to configure:
  1. Select Equation as the formula type
  2. Write your expression in the formula editor (see Using the Formula Editor below)
  3. Choose a null handling option
  4. Validate and preview your formula
  5. Click Save

Rollup

Aggregate values from related entities. Rollups traverse a relationship and apply an aggregation function to a field on the related records.
Use Rollup to summarize data across related records — total revenue from opportunities, count of open tickets, average deal size, etc.
How to configure:
  1. Select Rollup as the formula type
  2. Choose an aggregation type:
AggregationDescription
SUMTotal of all values
COUNTNumber of records
MINSmallest value
MAXLargest value
AVGAverage of all values
COLLECT_UNIQUEList of unique values
  1. Select the related entity and the relationship to follow
  2. Select the field to aggregate from the related entity
  3. Optionally add filter conditions to narrow which related records are included
Filter conditions support these operators: equals, not equals, contains, greater than, and less than. Multiple filters are combined with AND logic.
The field selector automatically filters to show only compatible fields. For example, SUM and AVG only show numeric fields, while COUNT works with any field type.

Cross-Object

Reference a field value from a related entity. Cross-object formulas follow a relationship and pull a single field value.
Use Cross-Object to surface a value from a related record without duplicating data — for example, displaying the account owner’s email on a contact record.
How to configure:
  1. Select Cross-Object as the formula type
  2. Select the source entity and the relationship to follow
  3. Select the source field to reference
  4. Optionally apply a transform:
TransformDescription
NoneNo transformation
UPPERConvert to uppercase
LOWERConvert to lowercase
TRIMRemove leading/trailing whitespace
SPLIT_FIRSTExtract the first part (before delimiter)

Time Calculation

Calculate time differences between dates. Time calculations work with date fields and return a numeric value in your chosen unit.
Use Time Calculation for date-based metrics — days until renewal, time since last activity, duration between two milestones, etc.
How to configure:
  1. Select Time Calculation as the formula type
  2. Choose a calculation type:
Calculation TypeDescriptionFields Required
Time BetweenDuration between two date fieldsStart date + End date
Time SinceTime elapsed from a past date to todayDate field
Time UntilTime remaining from today to a future dateDate field
  1. Select the required date field(s)
  2. Choose the time unit: Days, Hours, Minutes, Months, or Years

Using the Formula Editor

The formula editor is available when creating Equation-type formulas. It provides a rich editing experience with autocomplete, syntax highlighting, and validation.

Inserting Fields

There are two ways to insert a field reference into your formula:
  • Type @ in the editor to open the autocomplete dropdown. Start typing to filter by field name. Use arrow keys to navigate and press Enter or Tab to insert.
  • Click the Field button in the toolbar to open the field picker drawer. Browse or search for fields, including related fields from other entities.
Inserted fields appear as styled pills in the editor. In the formula expression, they are represented as {field_name}. Related fields follow the format {relationship_name}.{field_name} and appear in a separate section in the field picker.

Inserting Functions

Functions are also available through two methods:
  • Type @ and start typing a function name. Functions appear alongside fields in the autocomplete dropdown.
  • Click the Function button in the toolbar to open the function picker drawer. Browse by category, view syntax and examples, and click to insert.
Functions are loaded from the server, so you always see the latest available set. Each function in the picker shows its name, description, syntax, and category.

Toolbar

The toolbar provides quick-insert buttons for common elements:
  • Field and Function buttons open their respective picker drawers
  • Parentheses ( ) for grouping expressions
  • Arithmetic operators + - * /
  • Comparison operators = != > < >= <=

Operators

Arithmetic:
OperatorDescription
+Addition
-Subtraction
*Multiplication
/Division
Comparison:
OperatorDescription
=Equal to
!=Not equal to
>Greater than
<Less than
>=Greater than or equal to
<=Less than or equal to

Parsed Preview

As you type, a real-time parsed preview appears below the editor. It shows your formula with color-coded syntax highlighting:
  • Fields — highlighted as primary-colored pills
  • Functions — highlighted as accent-colored pills
  • Operators — displayed in muted text
  • Values (strings and numbers) — displayed in green
  • Parentheses — displayed in amber
This helps you visually verify that your formula is structured correctly.

Null Handling

For Equation formulas, you can choose how the formula handles null (empty) field values:
OptionBehavior
Return NullIf any referenced field is null, the formula returns null
Treat as ZeroNull numeric values are treated as 0; null text values are treated as empty strings
SkipRecords with null values in referenced fields are skipped

Validation

Click the Validate button to check your formula before saving. Validation checks for:
  • Syntax errors — Malformed expressions, unmatched parentheses, invalid function usage
  • Referenced fields — Lists all fields your formula depends on
  • Complexity score — Rates your formula’s complexity (Low, Medium, or High)
The validation status icon next to the button shows:
  • Empty circle — Not yet validated
  • Spinner — Validation in progress
  • Green checkmark — Validation passed
  • Red alert — Validation errors found
  • Orange alert — Validation warnings
Always validate your formula before saving. This catches syntax errors early and confirms the formula references valid fields.

Preview

After writing your formula, use the Preview section to test it against real records.
  1. Expand the Preview section at the bottom of the editor
  2. Select which entities to test against
  3. View the results table showing each entity name and its computed value
Preview results display the actual calculated value, null for empty results, or an error message if the formula fails for a specific record.

Managing Formula Fields

To edit a formula field:
  1. Navigate to Admin > Settings > Object Manager
  2. Find the formula field in the field list
  3. Click to edit and modify the formula configuration
  4. Validate, preview, and save
Changing a formula expression recalculates values for all existing records. If the formula references fields that don’t exist on some records, those records will show blank values.
Formula fields are read-only — their values are computed automatically and cannot be manually edited. If you need to override a calculated value, create a separate custom field instead.