Formula attributes

Create calculated attributes from your CRM data.

Table of Contents

Available on pro and enterprise plans.

Admins can create and manage attributes.
Members can create and manage attributes with Full access to the relevant object or list.

Formula attributes let you derive new values from existing data in your Attio workspace.

Use them to calculate things like deal stage duration, weighted pipeline value, ICP scores, or any other value you'd otherwise track manually.

This article covers how to create and manage formula attributes. For a full list of functions and operators, see the Formula functions library. For practical examples you can copy, see Formula attribute examples.

Formula attributes are currently in Beta.

Components of a formula

Formulas can be built using a combination of:

  • Attributes, or the values from your records that you want to calculate with. Reference an attribute by typing { in the formula editor.

  • Operators, or symbols used to perform calculations and comparisons. Some examples include + (add), == (equal to), and > (greater than).

  • Functions, or named actions that take inputs and return a value. Some examples include if(), dateAdd(), and timeSpentIn().

For a full list of available operators and functions, see the Formula functions library.

Create a formula attribute

To create a formula attribute, follow the same steps as creating any other attribute from the relevant object or list, selecting Formula as the attribute type.

The output type of a formula attribute is determined automatically by the formula. A formula that returns a number produces a number attribute; a formula that returns text produces a text attribute. If you want to override the detected type, select a type from the Output dropdown in the formula editor.

When the output type is a number or currency, you can optionally set the number of decimal places and how values are grouped using the Decimal places and Grouping settings in the attribute panel.

Write the formula

Click + Create formula to open the formula editor. Below the formula editor, a searchable list shows all available attributes, functions, and operators. Descriptions are shown where relevant, and every item includes an example you can click to insert into your formula. For a complete reference, see the Formula functions library.

As you type, Attio suggests matching attributes and functions. To reference an attribute, type { or use the Search below, and type the attribute name. Use the arrow keys to navigate suggestions and press Enter to insert one.

As you build the formula, you can preview its result for a specific record. Click the record picker above the formula editor and select a record to see the value the formula would return.

Use the undo and redo arrows next to the AI input to step backward or forward through your changes, whether made manually or with the AI composer.

Note: If you edit a formula in a way that changes its output type, all previously calculated values will be cleared.

Use the AI composer

If you know what you want a formula to do but are not sure how to write it, the AI composer can generate a formula from a natural language description.

  1. In the formula editor, type what you want the formula to calculate in the Describe the formula you want Attio to create input and press enter. For example: "Calculate the number of days this deal has been in the current stage."

  2. Review the generated formula. To adjust it, type a follow-up instruction in the Refine your formula input and press enter. You can refine as many times as you need.

  3. Click Save to insert the formula.

To use the AI on a formula you've already saved, open the attribute and click on the formula to return to the AI composer.

Checking for errors

Errors are highlighted in the formula editor as you type. Hover over a highlight to see the error description. Click Fix to have AI attempt to resolve the error automatically.

Reference one formula in another

You can reference an existing formula attribute inside a new formula up to three formulas deep, letting you build on computed values without duplicating logic.

For example, if you have a formula attribute called "Days in stage," you can reference it in a second formula the same way you would reference any other attribute, by typing { and selecting it from the list.

How formulas calculate

Attio keeps formula values up to date automatically and follows consistent rules when data is missing.

When formulas recalculate

Formula attributes calculate values for all records automatically when you first create them. If you edit the formula, Attio recalculates all values using the updated formula. Formula values also recalculate automatically whenever any referenced value changes.

Formulas that use now() or today() also recalculate once a day, around midnight UTC.

How empty values are handled

When an attribute has no value, formulas treat it as a special empty value called null. A few rules govern how null behaves:

  • If a formula returns null, it clears the attribute value for that record.

  • If any input to a function is null, the function usually returns null as well. For example, {Company.MRR} * 12 returns an empty value when {Company.MRR} is empty.

To handle empty values, you can:

  • Set a fallback with the ?? operator: {Company.MRR} ?? 0 returns 0 when MRR is empty.

  • Check for empty values directly: {Company.MRR} == null returns true when MRR has no value.

Some functions handle null differently:

  • Logical functions treat null as false.

  • contains() and count() treat null as empty, returning false and 0 respectively.

Frequently asked questions