---
title: "Map Field"
description: "Map field example with dynamic key-value pairs for structured data organization and validation in associative arrays. (Gitana 4.0)"
product: "Gitana"
version: "4.0"
url: "/documentation/gitana/4.0/forms/fields/map"
---

# Map Field

The `map` field.

### Properties

|  |  |
| --- | --- |
| Title | Map |
| Description | Field for objects with key/value pairs that share the same schema for values |
| Field Type | [map](/documentation/gitana/4.0/forms/fields/map.md) |
| Base Field Type | [array](/documentation/gitana/4.0/forms/fields/array.md) |

### Schema

| Property | Type | Default | Description |
| --- | --- | --- | --- |
| items | object |  | Schema for array items. |
| maxItems | number |  | Maximum number of items. |
| minItems | number |  | Minimum number of items. |
| uniqueItems | boolean |  | Item values should be unique if true. |

### Options

| Property | Type | Default | Description |
| --- | --- | --- | --- |
| animate | boolean | true | Up and down transitions will be animated |
| collapsed | boolean |  | Field set is initially collapsed if true. |
| collapsible | boolean |  | Field set is collapsible if true. |
| lazyLoading | boolean |  | Child fields will only be rendered when the fieldset is expanded if this option is set true. |
| legendStyle | string | button | Field set legend style. |
| properties |  |  |  |

## Example 1

Map field for user profiles. A map field allows you express unique key IDs for an associative array object. Click on the "view" button to show the resulting JSON.

## Example 2

Here is an example where we hide the `_key` field.

## Example 3

Map field rendered in display-only mode.

## Example 4: Map Validation

This example shows an object with an empty `_key` property. As a result, the form renders with a validation error. If a non-empty key is filled in, the form validates just fine.
