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

# Extend a dataset's schema

> Add form fields to an existing dataset without splitting or replacing its leads.

When you add a question to a lead form, update both the dataset's columns and
the event pipeline's transform. A field can appear on a page and be submitted
without being stored if the transform never includes it in its output.

Ask the agent to add the column to the existing dataset and map the form field
into every pipeline that receives it. The agent can discover
`update_dataset_schema` through `find_tools`. It should first consult
`list_dataset_purposes` to reuse the current write target.

The agent supports column additions and schema declarations. Removing, renaming,
or retyping stored columns requires the operator CLI or API.

## Add a column

Use `add_column` to extend an existing dataset. This preserves its rows,
existing column definitions, and permanent lead identities. Do not create a
second leads dataset to add a field.

```json theme={null}
{
  "operations": [
    {"type": "add_column", "column": "is_broker", "column_type": "text"}
  ]
}
```

Save this request as `add-broker.json`, then run:

```bash theme={null}
erdo --org acme datasets update-schema acme.leads --input add-broker.json
```

The same request works with `POST /v1/datasets/acme.leads/schema`. In MCP,
use `erdo_update_dataset_schema` with `dataset_slug` and the operations.

A populated dataset using permanent lead identity accepts only additive column
operations. Send additions separately from `declare_schema`, class changes,
removals, renames, or type changes. The platform-owned `canonical_lead_id`
column cannot be changed. Existing records have no answer for a newly added
question; the addition does not invent historical answers.

## Connect and verify the form

After adding the column, update the transform to include the submitted field
and normalize localized answers to a consistent value. Test the transform with
representative payloads, save the pipeline, and verify a marked test submission
in the dataset. Repeat for every page's capture pipeline.

Keep different questions in different columns. For example, “I am a broker”
and “I am represented by a broker” are separate answers even if their labels
share the word “broker.” A field required by the page should not make the
pipeline reject partial lead submissions: keep the capture request's required
fields compatible with the form's first submission.


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