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

# Data Model Editor

> Map values to a data model through a master-detail form — with support for objects, arrays, and unions

The **Data Model Editor** is a master-detail form for mapping values onto a data model. A tree view on the left shows the model's structure — its objects, arrays, and unions — while a detail editor on the right lets you fill in the leaf properties of whichever container you select. This makes even deeply nested and repeating structures straightforward to populate.

***

## How It Works

The editor derives its form from the data model's schema so the form always matches the model's shape:

1. The data model's schema definition is converted into a standard JSON Schema.
2. The JSON Schema is transformed into a strongly-typed field structure that is easy to render as a form.
3. The form is rendered as a **master-detail** layout — a tree of containers plus a detail editor for the selected container's fields.

***

## Containers and Leaves

The editor distinguishes between the two kinds of fields in a schema:

* **Containers** — objects, arrays, and unions that hold other properties. These appear in the tree view so you can navigate the structure.
* **Leaves** — terminal fields that resolve to an input (a resource reference, a dropdown selector, a text value, and so on). These appear in the detail editor for the container you have selected.

### Unions

A **union** is a discriminated field whose available properties change based on a selection — for example, a value that can be an object, an array, or a plain string. The editor lets you pick the active type and then edit only the properties valid for that choice.

### Arrays

Arrays are fully supported: add, edit, and remove items, each rendered with the detail editor for the array's item type.

***

## Working With the Editor

<Steps>
  <Step title="Open the data model">
    Open the data model you want to populate in the template builder.
  </Step>

  <Step title="Navigate the structure">
    Use the tree view to move between containers — objects, arrays, and unions.
  </Step>

  <Step title="Map the leaf values">
    Select a container and fill in its leaf properties in the detail editor. For unions, choose the active type first; for arrays, add and edit items.
  </Step>
</Steps>

<Tip>
  Leaf fields can reference flow resources, so you can map live values onto the model rather than hard-coding them.
</Tip>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Variables" icon="brackets-curly" href="/features/variables">
    Compute and reuse values across your flow
  </Card>

  <Card title="Live Page Services" icon="server" href="/features/live-page-services">
    Expose server-side data to your pages
  </Card>
</CardGroup>
