
# Structured & Media Fields

Six field types storing a value with more shape than a string or a number: nested data, lists, colours, source code, coordinates, and scannable codes. All share the [base field properties](/en/docs/tables-overview#base-field-properties).

| Type          | Stores                                |
| ------------- | ------------------------------------- |
| `json`        | Structured JSON data.                 |
| `array`       | A list of values.                     |
| `color`       | A hex colour value.                   |
| `code`        | Source code with syntax highlighting. |
| `geolocation` | Latitude/longitude coordinates.       |
| `barcode`     | A barcode value (media category).     |

For the derived and interactive types — `formula`, `count`, `autonumber`, `button` — see [Computed & Action Fields](/en/docs/advanced-fields).

## `json`

Stores structured JSON data.

| Property | Description                         |
| -------- | ----------------------------------- |
| `schema` | Optional object, accepted and kept. |

```yaml
- { id: 5, name: metadata, type: json, required: false }
```

:::callout
**`schema` does not validate anything.** It is declared as an empty object in the field schema, so any object is accepted and no JSON-Schema semantics are applied to the stored value. Validate the shape in an automation or at the application boundary if it matters.
:::

## `array`

Stores a list of values.

| Property   | Description                                  |
| ---------- | -------------------------------------------- |
| `itemType` | Data type of array elements (e.g. `string`). |
| `maxItems` | Maximum number of elements (integer ≥ 1).    |

```yaml
- { id: 6, name: tags, type: array, itemType: string, maxItems: 10 }
```

`maxItems` is enforced; `itemType` is an unconstrained string, so it documents intent rather than restricting what may be stored.

## `color`

Stores a colour in hexadecimal format, rendered with a colour picker.

| Property  | Description                                               |
| --------- | --------------------------------------------------------- |
| `default` | Default colour as a 6-digit hex value with a leading `#`. |

```yaml
- { id: 7, name: brand_color, type: color, required: true, default: '#3B82F6' }
```

This is the one field on this page with a real format check: `default` must match `#` followed by exactly six hex digits. Three-digit shorthand (`#3BF`) and named colours (`red`) are rejected at config decode.

## `code`

Stores source code as plain text, edited with syntax highlighting (CodeMirror 6).

| Property      | Description                                                                                                 |
| ------------- | ----------------------------------------------------------------------------------------------------------- |
| `language`    | **Required.** Language for highlighting (e.g. `javascript`, `typescript`, `yaml`, `json`, `python`, `sql`). |
| `lineNumbers` | Boolean. Show line numbers.                                                                                 |
| `readOnly`    | Boolean. Make the editor read-only.                                                                         |
| `minLines`    | Minimum visible lines (integer ≥ 1).                                                                        |
| `maxLines`    | Maximum visible lines before scrolling (integer ≥ 1).                                                       |
| `tabSize`     | Tab size in spaces. Integer from **1 to 8**.                                                                |

```yaml
- { id: 8, name: snippet, type: code, language: typescript, lineNumbers: true, tabSize: 2 }
```

`language` is required but unconstrained — the listed values are the ones with highlighting support, and an unknown or empty string still passes validation. `tabSize` has no schema default; the editor falls back to `2` when the field omits it.

## `geolocation`

Stores geographic coordinates (latitude and longitude) for location-based features. It takes no type-specific properties beyond the base field properties.

```yaml
- { id: 9, name: office_location, type: geolocation, required: true }
```

## `barcode`

Stores a barcode value for product identification and inventory. It belongs to the media category alongside the [attachment fields](/en/docs/attachment-fields), and is documented here with the other specialised value fields.

| Property | Description                                |
| -------- | ------------------------------------------ |
| `format` | Barcode format (e.g. `EAN-13`, `CODE128`). |

```yaml
- { id: 10, name: product_barcode, type: barcode, required: true, format: EAN-13 }
```

`format` is an unconstrained string: it records which symbology the value uses, and nothing checks the value against it.

## Related Pages

- [Computed & Action Fields](/en/docs/advanced-fields) — `formula`, `count`, `autonumber`, `button`.
- [Attachment Fields](/en/docs/attachment-fields) — the other two members of the media category.
- [Field Types Overview](/en/docs/field-types-overview) — every field type by category.
- [Tables Overview](/en/docs/tables-overview) — the base properties every field shares.
- [Table Validation](/en/docs/table-validation) — enforcing shape where the field schema does not.
