Formula attribute examples

Practical examples to help you get started with formula attributes.

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 workspace. These four examples cover common formulas for GTM teams, from pipeline forecasting to pricing calculations.

For a complete reference of all available functions and operators, see the Formula functions library. To learn how to create a formula attribute, see Formula attributes.

Formula attributes are currently in Beta.

How to use these examples

Each example gives you a prompt to paste into the AI composer, which appears when you create or edit a formula attribute.

The composer builds the formula for you, referencing the actual attributes in your workspace, so you don't need to fix attribute references by hand or learn the formula syntax first.

For each example:

  1. Create a formula attribute on the object we recommend for that formula.

  2. Paste the prompt into the composer.

  3. Adjust the parts in [square brackets] to match your attribute names and values.

  4. Check the preview at the bottom of the composer shows a sensible value, then click Save.

Some examples reference custom attributes, such as a contract start date or a discount percentage, that may not exist in your workspace yet. Where that's the case, we call it out so you can create and populate the attribute before building the formula. The composer can only reference attributes that already exist.

Weighted pipeline value

A weighted pipeline adjusts each deal's value by its likelihood of closing, giving you a more accurate forecast than raw pipeline totals.

For example, a $50,000 deal with a 40% close probability contributes $20,000 to your weighted pipeline.

The formula that calculates this weighted deal value will be unique to you as it will contain your own deal stages, and the probabilities you set for each stage.

For the full setup, see Setting up a weighted pipeline.

Count linked records (rollup)

A count formula tells you how many records are linked to the current record through a relationship attribute, giving you a number you can filter, sort, and report on.

You can build this on any object with a relationship attribute that links more than one record.

This formula is quicker to build by hand than with the AI composer, so we'll build this directly in the formula editor.

To count the people linked to a company through the Team attribute, create a formula attribute on the Companies object, then:

  1. Type count and select the count() function from the suggestions. Attio inserts count() with your cursor between the parentheses.

  2. Type the name of the relationship attribute you want to count in the Search... bar in the bottom panel, then select it from the suggestions. In this example, that's the top-level Team attribute.

  3. The editor now reads count({Team}). Set Output to Number.

  4. Select Save.

Until the function has a valid attribute inside it, the editor shows warnings such as Function arguments missing or Invalid argument count on count. This is expected and clears once you add the attribute in step two.

This formula returns the size of each company's team as a whole number. {Team} is a system relationship attribute that Attio creates on the Companies object by default, so you don't need to set anything up first. It holds every person whose Company attribute is set to that company, and the formula counts those people.

Stale deal alert

A stale deal alert flags deals that have been sitting in the same stage for too long.

This formula works best on the Deals object. Create a formula attribute there, then paste this prompt into the AI composer:

Output the text "Stale" if this deal has been in its current [Deal stage]
for more than [14] days, and "Active" otherwise.

Adjust [Deal stage] to the name of your pipeline stage attribute if yours is different, and [14] to match your own definition of stale. The composer builds a formula that checks when the stage was last changed and compares that date against your threshold.

Checking when a value was last set only works with select and status attributes. It is not supported on text, number, date, or other attribute types. If the composer can't build this formula, check that your stage attribute is a select or status type.

We recommend naming this attribute Stage health, which works naturally as a filter label and makes the values (Stale, Active) self-explanatory in views and reports.

Take action on stale deals

Once you've created the attribute, you can build a single view that each sales person can use to see their own stale deals.

  1. Open your Deals object or pipeline list.

  2. Click Filter.

  3. Add two conditions: Deal owner is Current user, and Stage health contains Stale.

  4. Save the view.

Because the Deal owner filter uses Current user rather than a specific user, any sales person who opens this view sees only their own stale deals. Save it as a shared view and it works for the whole team without creating a separate view per user.
This view updates daily as the formula recalculates, so it always shows deals that have gone stale since you last checked.

You can also automate follow-up with a workflow. Set a recurring daily trigger, add a Find records step filtered to deals where Stage health is Stale, then create a task assigned to the Deal owner for each result. Every morning, stale deals automatically land in the owner's task list without anyone having to check the view. See our overview of workflows for more detail.

To build this workflow with Ask Attio, use the prompt below. This workflow uses the Stage health attribute described above.
copy this prompt into ask attio
Build a workflow that uses a recurring schedule trigger to fire at 8am every morning. Next, it should find all deal records where the [Stage health] attribute value is 'Stale', and then it should loop over the results, creating a task for each deal it finds. The name of the task should be 'Follow up on this stale deal: {Deal name}' and the owner of the task should be the deal owner. 

Lead scoring

A lead score combines multiple signals into a single priority number. Where you store the score depends on your sales motion: outbound teams typically score Companies or People based on ICP fit and intent signals, while inbound teams usually score the record that captures the inbound event, typically a Deal.

Lead scoring only works if you're already capturing the signals you want to score. Effective models combine two dimensions: fit (would this be a good customer?) and intent (are they showing buying signals?). Use fit to qualify and intent to prioritize. Some signals are populated by Attio automatically, while others come from your own tools and processes:

Signal

Dimension

Where the data comes from

Job title, company size, industry, and location

Fit

Attio's enrichment

Email and meeting history

Intent

Attio’s email and calendar syncing, including the First interaction and Last interaction attributes

Funding, hiring, and company news

Fit and intent

Attio’s Web/Custom agents via a workflow

Inbound channel and form answers, such as purchase timeline

Intent

Your signup and demo forms, sent to Attio via a form integration, Zapier, or the API

Lead source

Intent

Marketing attribution, such as UTM parameters captured at signup

Product usage

Intent

Your product database or analytics tool, synced via the API

Website visits and tech stack

Intent

Data providers and visitor deanonymization tools

For signals that are publicly available, agents can find the data and add it to the record automatically. Use the Web agent or Custom agent steps in a workflow to research things like funding rounds, hiring activity, or recent news. For signals that live in your own systems, such as product usage or form answers, you'll need to sync the data via a form integration, Zapier, or the API.

The example below works best on the Deals object for inbound scoring, or on the People and Companies objects for outbound scoring.

Because your signals, attribute names, and point weights reflect your own ICP, this prompt is a template. Replace the bracketed parts with your own signals before pasting the prompt into the composer:

Create a lead score by adding together points from three signals.
For every signal: if the attribute is empty, or its value is not
listed below, that signal adds 0 points. Never let one signal make
the whole score empty.

- [Inbound channel]: [Trial signup] adds 3 points, [Talk to sales]
  adds 2 points, [Event] adds 1 point. Any other value adds 0 points.
- [Time to purchase]: [Immediately] adds 3 points, [1-3 months]
  adds 1 point. Any other value adds 0 points.
- The associated company's [Employee range]: [251-1K] adds 3 points,
  [51-250] adds 2 points and [1K-5K] adds 2 points.
  Any other value adds 0 points.

Output a number.

This formula scores three signals: inbound channel, purchase timeline, and company size, then adds them together. A deal from a company with 1K–5K employees that signed up via a trial and needs a CRM immediately scores 9 (3 + 3 + 3). A deal from an 11–50 person company that came via an event with no purchase timeline scores 1 (1 + 0 + 0).

To use this example, the formula references three attributes from two sources:

  • {Inbound channel} and {Time to purchase} are custom select attributes populated by your own data. This could be a 'talk to sales' form that triggers an Attio workflow, or an integration via Zapier our Attio's API. These attributes and their values don’t exist in Attio by default, they need to be set up and populated by you.

  • {Associated company > Employee range} is populated by Attio's enrichment on the linked company record.

Adjust the attribute names, option values, and point weights to match your own ICP criteria, and add or remove scoring conditions by extending the formula with additional if() statements.

The ?? operator provides a fallback when an attribute has no value on a record. Each signal block is wrapped in (... ?? 0), so a deal with a missing value scores zero for that signal instead of blanking the whole score. Without ??, one missing value could cause the entire score to show as empty. Wrap any signal that might be empty, especially those populated by integrations or forms.

Custom pricing

Formula attributes can handle your revenue math directly on the record. The examples below cover four common pricing calculations. Once you've added them to your records, you can surface the values in list views, use them as report metrics, or reference them in other formulas.

Apply a discount to deal value

This formula works best on the Deals object, with a currency output. Paste this prompt into the composer:

Apply the [Discount %] attribute to [Deal value] as a percentage
discount. Output the result as a currency.

This formula returns the deal value after applying a percentage discount.

{Deal value} is a standard attribute on the Deals object. You'll need to create {Discount %} as a number attribute and populate it manually or via a workflow when a discount is agreed.

Seat-based pricing

This formula works best on the Deals object, with a currency output. Paste this prompt into the composer:

Multiply [Seats] by [Price per seat] to calculate total contract
value. Output the result as a currency.

This formula calculates total contract value from a seat count and a unit price. Both {Seats} and {Price per seat} are custom number attributes you'll need to create on the Deals object. Adjust the attribute names in the prompt to match your pricing model.

This approach works well for simple, single-product pricing where the price per seat doesn't change often. If you sell multiple product types, have variable quantities across line items, or want pricing updates to flow through automatically, a two-object model is a better fit: a Products object stores your plan catalog with list prices, and a Line items object stores deal-specific instances with quantities and calculated totals, linked back to Deals via relationship attributes. Learn more about custom objects.

If you reference a live price directly from a related Products record, historical deal values will be wrong when the price changes. To avoid this, store the calculated value on the line item at the time the deal is created rather than referencing the product price dynamically.

Days to renewal

This formula works best on the Workspaces or Companies object, with a number output. Paste this prompt into the composer:

Calculate the number of whole days until this contract renews.
The renewal date is [12] months after the [Start date] attribute.

Start date is a custom date attribute you'll need to create on your Workspaces or Companies object to store the contract start date. Create the attribute, then backfill the values for your current customers before using this formula. Start dates are typically entered manually or synced from a billing system.

Adjust the [12] to match your contract length in months. For example, use [24] for a two-year contract.

Attio's date subtraction operator returns a value in milliseconds. Dividing by 86400000 (the number of milliseconds in a day) converts this to days. floor() rounds down to the nearest whole day.

{Start date} is a custom date attribute you'll need to create on your Workspaces or Companies object to store the contract start date. You can create the attribute, then backfill the values for your current customers before using this formula. Start dates are typically entered manually or synced from a billing system.

Adjust the 12 to match your contract length in months. For example, use 24 for a two-year contract.

MRR to ARR conversion

This formula works best on the Workspaces or Companies object, with a currency output. Paste this prompt into the composer:

Multiply [MRR] by 12 to convert monthly recurring revenue to an
annual figure. Output the result as a currency.

This formula converts a monthly recurring revenue value to an annual figure. {MRR} is a custom currency attribute you'll need to create on your Workspaces or Companies object to store monthly recurring revenue. It's typically entered manually or synced from a billing system.

Frequently asked questions