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

# Data extraction

> How to define data extraction fields so Tuner pulls structured values out of each call, and where those values show up.

<Info>
  Data extraction fields live in **Agent Settings > Analysis Setup**, in the **Data Extraction** section. Tuner fills them for each call it analyzes.
</Info>

## What is data extraction?

A **data extraction** field is a structured value Tuner pulls out of each call transcript, such as an appointment time, an order number or whether the caller asked for a refund. You name the field, pick its data type and describe what to look for. Tuner then fills the field for every call, so you can read call content as data and use it in rules and alerts.

## Add a field

<Steps>
  <Step title="Open Analysis Setup">
    In **Agent Settings**, open the **Analysis Setup** tab and find the **Data Extraction** section.
  </Step>

  <Step title="Open the field dialog">
    Click **Add**. The **Add Custom Field** dialog opens.
  </Step>

  <Step title="Name the field">
    Enter a **Field Name**, for example `appointment_time`. The name is the key the value appears under on each call. Use lowercase letters and underscores. Each field name must be unique within the agent.
  </Step>

  <Step title="Pick a data type">
    Choose a **Data Type**: **Text**, **Number**, **Boolean** or **Enum**. See [Field types](#field-types).
  </Step>

  <Step title="Add enum options (Enum only)">
    If the type is **Enum**, enter the allowed values in **Enum Options** as a comma-separated list, for example `positive, neutral, negative`.
  </Step>

  <Step title="Describe the field">
    In **Instructions to Extract This Field**, describe how Tuner should identify and extract the value. See [Write good extraction instructions](#write-good-extraction-instructions).
  </Step>

  <Step title="Save">
    Click **Save**. The field appears in the **Data Extraction** section and is filled for calls Tuner analyzes from then on.
  </Step>
</Steps>

## Field types

| **Data Type** | API `field_type` | What Tuner returns |
| - | - | - |
| **Text** | `text` | Free text, such as a name, a date or a short phrase. |
| **Number** | `number` | A number, such as a quoted price or a count. |
| **Boolean** | `boolean` | `true` or `false`. |
| **Enum** | `enum` | One of the values you listed in **Enum Options**. |

Tuner stores every extracted value as text. When Tuner finds no value for a field, the field shows **N/A** on the call.

## Write good extraction instructions

* **Be specific**: name exactly what to look for. The more specific the instructions, the more accurate the extraction.
* **Say the format you want**: for example "a short comma-separated list" or "the date and time as stated by the caller".
* **Say what to do when the value is missing**: for example "Return null if the caller didn't give an address."
* **Use Enum for fixed sets**: when a value can only be one of a few options, use **Enum** so every call uses the same values.
* **Review regularly**: check extracted values on real calls and refine the instructions when they drift.

## Read the results

Open a call in [Call Logs](/docs/observability/call-logs) and select the **Data Extraction** tab. It lists each field name with the value Tuner extracted, or **N/A** when there's no value. If a [data retention](/docs/observability/data-retention) policy removed caller data from the call, the values show as **Removed**.

Tuner doesn't extract data for a call whose [call outcome](/docs/evaluation/call-classification#call-outcome) has **Stop Analysis** turned on.

## Use fields in rules and alerts

* **Rules**: pick the **Data Fields** source to tag calls with a label or red flag based on a field's value. Text, Boolean and Enum fields support **Equals (=)** and **Not equal (!=)**; Number fields support all six comparison operators. See [Condition sources](/docs/evaluation/red-flags#condition-sources).
* **Alerts**: pick a field from the **Data Fields** group in **Select field** to get notified when calls match a value. See [Alerts](/docs/observability/alerts).

## Manage fields

* **Edit**: click the edit icon on a field. The **Edit Custom Field** dialog opens with the same settings. Click **Save Changes**.
* **Delete**: click the delete icon on a field, then confirm in **Delete Data Extraction Field**.

Fields marked **System** are added by Tuner and can't be edited or deleted.

## Limits

| Field | Limit |
| - | - |
| **Field Name** | 1 to 100 characters, unique within the agent |
| **Instructions to Extract This Field** | 1 to 5,000 characters |
| **Enum Options** | Required for **Enum** fields, up to 50 options |
| Extracted value | Up to 250 characters; longer values are cut off |

The **Field Name** and **Instructions to Extract This Field** limits are enforced by the dashboard form.

To manage fields through the API, see the Agent Settings group in the API Reference, starting with [Create Extraction Field](/api-reference/agent-settings/create-extraction-field).

## Next steps

<CardGroup cols={2}>
  <Card title="Create rules" href="/docs/evaluation/red-flags" icon="flag">
    Tag calls with labels and red flags based on extracted values.
  </Card>

  <Card title="Set up alerts" href="/docs/observability/alerts" icon="bell">
    Get notified when extracted values cross a threshold.
  </Card>
</CardGroup>


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