> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: About Collection Fields

## Article: About Collection Fields

## Article Link: https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/introduction/about-collection-fields.md

## Article Content:

# About Collection Fields

Fields define the structure of a [collection](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/introduction/about-collections.md). They act as the collection's columns, describing what each item can store and what type of data each value is.

You can manage fields in the **Wix Data** view, in the [Code tab](https://dev.wix.com/docs/studio-two/get-started/about-the-code-tab.md#work-with-collections), in the [CMS dashboard](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields), or in code with the [Data Collections API](https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-collections?apiView=SDK.md). To add a field to an existing collection, see [Add a Field to a Collection](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/introduction/add-a-field-to-a-collection.md).

## Field IDs

Each field has a unique ID that you use to refer to it in code. A field's ID can differ from the display name that the CMS dashboard shows.

To copy a field's ID, see [Find Collection and Field IDs](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/introduction/find-collection-and-field-ids.md).

## Field types

Each field has a type that describes the kind of data it holds. The CMS groups field types into these categories:

- **Essentials**: Basic types, such as text, numbers, dates, and booleans.
- **Media**: Images, audio, video, and documents.
- **Time and location**: Times, locations, and addresses.
- **JavaScript**: Objects and arrays.

Field types provide structure but aren't strictly enforced. An item can store a value that doesn't match its field's type, though this isn't recommended.

## Reference fields

Reference fields link items in different collections. A reference field stores the ID of an item in another collection, so you can connect related data.

A single reference field links to one item. A multi-reference field links to several items in the other collection.

To add a reference field to a collection, see [Field types](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/introduction/create-a-collection.md#field-types).

## System fields

Every collection automatically includes these system fields:

- `_id`: The item's unique ID.
- `_createdDate`: When the item was created.
- `_updatedDate`: When the item was last changed.
- `_owner`: The ID of the visitor or member who created the item.

The CMS manages system fields, and they're mostly read-only. You can set `_id` to a unique value of your choice when you add a new item with [Insert Data Item](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/insert-data-item?apiView=SDK.md) or [Save Data Item](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/save-data-item?apiView=SDK.md). You can also change `_owner` if the caller has site-owner permissions.

## Undefined fields

An undefined field is a field that appears in a collection's items but isn't part of the collection's structure. This can happen when you add an item with the Data API that includes a key the collection doesn't define, or when you [restore a previous version of a site](https://support.wix.com/en/article/viewing-and-managing-your-site-history).

Undefined fields give you flexibility while a data structure evolves, but it's best practice to define all fields properly in your collection.

## See also

- [About Collections](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/introduction/about-collections.md)
- [Find Collection and Field IDs](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/introduction/find-collection-and-field-ids.md)