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

# Custom fields

> Define your own contact data, pick a field type, fill it in on a contact, and use the field as a merge tag.

export const Screenshot = ({id, src, srcDark, alt, caption}) => {
  if (!src) {
    return <Placeholder id={id} kind="screenshot" label="Screenshot coming soon" description={alt} icon={<ImageIcon />} />;
  }
  return <figure className="brd-media" data-media-id={id}>
      <img className="brd-media-frame block dark:hidden" src={src} alt={alt} />
      <img className="brd-media-frame hidden dark:block" src={srcDark || src} alt={alt} />
      {caption && <figcaption className="brd-media-caption">{caption}</figcaption>}
    </figure>;
};

Custom fields hold data Brudcast has no built-in place for: a customer's plan, their city, their
renewal date. Define a field once, then fill it in on each contact and use it as a merge tag.

<Screenshot id="ss-contacts-custom-fields-hero-table" alt="The Custom Fields page listing Company Size, Plan and Renewal Date with each field's key and type beside it" />

<Info>
  **Before you start:** a field's key and type are fixed the moment you create it, so decide what
  the field holds before you add it. Values can't be brought in by a CSV import; you fill them in on
  each contact, collect them through a form, or write them through the API.
</Info>

## Create a field

<Steps>
  <Step title="Add the field">
    Go to **Contacts > Custom Fields** and select **Add Field**. Enter a **Field Name**, such as
    "Company Size". This is the label people see on the contact page.
  </Step>

  <Step title="Check the key">
    The **Field Key** is generated from the name, for example `company_size`. It's how you refer to
    the field in merge tags and the API. A key starts with a lowercase letter and holds lowercase
    letters, digits and underscores, up to 100 characters. Each key must be unique in your
    organization.
  </Step>

  <Step title="Choose a type">
    Pick a **Field Type**, then select **Create Field**.
  </Step>
</Steps>

## Field types

| Type                  | What it stores                   | Editor on the contact page |
| --------------------- | -------------------------------- | -------------------------- |
| **Text**              | Any text                         | A text box                 |
| **Number**            | A number                         | A number box               |
| **Date**              | A calendar date                  | A date picker              |
| **Boolean**           | Yes or no                        | A switch                   |
| **Select (Dropdown)** | One value from a list you define | A dropdown                 |

A **Select (Dropdown)** field needs at least one option and can have up to 50. You can also give a
field a **Description** and mark it **Required**.

<Warning>
  You can't change a field's key or type after you create it. To change either, create a new field
  and copy the values across. Everything else about a field, such as its name and description, can
  be edited later.
</Warning>

The key and type are fixed because they're what everything else points at: merge tags in templates
and campaigns, form mappings, and your own code calling the API. Renaming a key would quietly break
every message using it, and a tag that no longer matches a field sends as empty text rather than
failing loudly.

## Fill in a value

Open a contact and select the pencil icon on the **Custom Fields** card on the **Overview** tab.

Values can also arrive on their own:

* **From a form.** Map a question to **Custom field** so answers land on the contact. A field only
  accepts questions that produce the right kind of value. See
  [Map answers to contact fields](/forms/create-a-form#map-answers-to-contact-fields).
* **From a migration.** Custom fields come across from your old provider before your contacts do, so
  contacts land with their values. See [Run a migration](/migrations/run-a-migration).
* **From your app.** Write values through the [Platform API](/api-reference/introduction).

A CSV import is the exception: it maps the built-in columns only, so custom field values can't be
imported from a spreadsheet.

## Use a field as a merge tag

Each field's key works as a merge tag, such as `{{company_size}}`. Insert one with **Insert
variable** wherever you write copy, and it's filled in per recipient when the campaign sends.

Five tag names are reserved and always come from the contact record: `first_name`, `last_name`,
`full_name`, `email` and `unsubscribe_url`. A custom field can't take one of them over. See
[Placeholders and merge tags](/templates/placeholders-and-merge-tags).

## Related

<Columns cols={2}>
  <Card title="Placeholders and merge tags" icon="braces" href="/templates/placeholders-and-merge-tags">
    Personalize a message with the fields you just created.
  </Card>

  <Card title="Add and edit contacts" icon="user-pen" href="/contacts/add-and-edit-contacts">
    Fill in a contact's fields, tags and notes.
  </Card>

  <Card title="Create a form" icon="clipboard-pen" href="/forms/create-a-form#map-answers-to-contact-fields">
    Collect custom field values from the people who sign up.
  </Card>
</Columns>
