> ## Documentation Index
> Fetch the complete documentation index at: https://docs.allgoodhq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How formulas find your data

> Learn how a formula names the record type and field it reads, where to look up field names, and what happens when data is missing or a record has duplicates.

A formula can only use data it can find. To find a field, a formula needs two names: the **record type** and the **field**. This article explains how to write those names, where to look them up, and what a formula does when the data is not there. Read it before you write your first formula.

## How a formula reads a field

You write a read with a dollar sign, backticks, and the two names joined by a period:

```
$`person.title`
```

The first name, `person`, is the record type. The second name, `title`, is the field. Together they say "the title on this person's `person` record."

The record type comes first because one person can carry several record types at once. A person might have the standard `person` record, plus a record that came from Salesforce. Each one can hold a field called `title`, with a different value. The record type tells the formula which one you mean.

| What you type | What it reads |
| - | - |
| `` $`person.title` `` | The `title` field on the standard `person` record |
| `` $`company.industry` `` | The `industry` field on the standard `company` record |

MK also reminds you of this while you type. Select the **?** at the end of a formula row to see the same rule and two examples.

Three rules keep reads working:

* **Always include the record type.** A bare `` $`email` `` looks for a record type named "email" and finds nothing.
* **Match the name exactly.** Names are case-sensitive. `firstName` works. `firstname` and `FirstName` do not.
* **Expect no warning for a wrong name.** A misspelled name does not cause an error. The formula reads it as "no value" and carries on. If a formula returns blank on every row, check the spelling first.

## Standard fields

MK gives every person and company a set of standard fields. Their names use camelCase: lowercase first, then a capital letter for each new word.

| Record type | Standard fields |
| - | - |
| `person` | `email`, `firstName`, `lastName`, `fullName`, `title`, `companyName`, `phone`, `consent`, `lifecycleStage`, `timezone` |
| `company` | `name`, `domain`, `website`, `industry`, `employeeCount`, `annualRevenue`, `city`, `state`, `country`, `lifecycleStage` |

Records from connected systems carry their own fields under their own record type, such as `sfdc_lead`, and keep the names the other system uses. A Salesforce email field, for example, reads `` $`sfdc_contact.Email` `` with a capital E. Your account may also add fields. Which record types you have depends on what is connected, so check **Data Shape** for yours, as described in the next section.

## Find a field name

Each record type has a **Data Shape** page that lists every field MK has seen on records of that type.

**1. Open the record types**

Select **Orchestration** in the top bar. In the left sidebar, under **Database**, select **Record Types**.

**2. Pick a record type**

Select the record type you want, such as Salesforce Contact. The short name under each title, such as `sfdc_contact`, is the name you type in a formula.

**3. Open Data Shape**

Open the **Data Shape** tab.

**4. Search for the field**

Type part of the name or label in the search box.

You will see one row per field. Use the **Any type** menu to show only one kind of value, and the sort menu to put the most complete fields first.

| Column | What it shows |
| - | - |
| Field | The field's label when it has one, with the exact field name under it. Use the exact name in your formula. |
| Type | The kinds of value MK has seen in the field, such as text or number |
| Coverage | How many of the sampled records have a value in the field |
| Example values | A few real values, so you can see how the data looks |

MK builds this page from the records themselves, using up to 10,000 of them. It shows what arrived, not what someone planned. A rarely filled field can be missing from the sample.

> [!NOTE]
>
> You type field names into a formula by hand. The page has no copy button, so check the spelling against the **Field** column.

If you cannot open **Data Shape**, ask an admin. They can also add friendly labels to fields.

## What happens when data is missing

If a record does not have a field, or does not have the record type at all, the formula reads **no value**. It does not stop with an error.

| Situation | What the formula reads |
| - | - |
| The record has the field and it is filled | The stored value |
| The record has the field but it is empty | No value, empty text, or spaces, depending on how the data arrived |
| The record has the record type but not the field | No value |
| The record does not have the record type | No value |

Each kind of no-data behaves a little differently in a formula. [Handle blank and messy values in formulas](https://docs.allgoodhq.com/mk/formulas/handle-blank-values.md) shows how to check for each.

## When a person has several records of one type

A person can have more than one record of the same type. For example, two `sfdc_lead` records after a merge. A formula reads one of them: the one that MK created most recently. If two were created at the same moment, MK uses the one with the higher internal ID.

You do not need to do anything to get this. It matters when a list shows an older value than you expected. The newer record may hold a different value.

## One record at a time

A formula on a list reads the record in that row, and the record types attached to it. It cannot look up a related record. For example, a formula on a people list cannot read `company` fields through the person's company. If you need a company detail on a people list, use a person field such as `person.companyName`, or build the list on the company side.

## How fresh the data is

A list uses the data in MK at the moment it loads. Reload the list, and formulas use the latest data. New data from an outside system, such as Salesforce, shows up after MK syncs it. How often that happens depends on how the system is connected.

## Related articles

* [What formulas are and when to use one](https://docs.allgoodhq.com/mk/formulas/what-formulas-are.md)
* [Handle blank and messy values in formulas](https://docs.allgoodhq.com/mk/formulas/handle-blank-values.md)
* [Filter a list with a formula](https://docs.allgoodhq.com/mk/formulas/filter-a-list.md)
* [Formulas FAQ](https://docs.allgoodhq.com/mk/formulas/faq.md)

If a formula returns blank on every row and the field name looks right, contact allGood support. Include the formula, the record type, and a screenshot of the field in **Data Shape**.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.