# Schema

Your collection fields internally are saved as JSON and UI schemas. We provide an easy to use schema builder where you can manage your fields without knowing anything about these schemas. We also provide an option to see and manually edit collection schemas which can be useful if you want to recreate a collection by copying a schema from one collection and pasting it to another.

## Schema builder

Schema builder allows you to add fields to your collection. The builder can be accessed by opening your collection or creating a new collection.

![Schema builder view](https://760328771-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LwSkuCpTNI_AerL8J2a%2F-M-52EG-1RZ9vvwy8tW2%2F-M-53iPxzZHqjKGSIstt%2Fschema_1.PNG?alt=media\&token=2eb191e3-80d8-4f92-95f7-8526ee6df72e)

| Field Action | Description                                                                                                           |
| ------------ | --------------------------------------------------------------------------------------------------------------------- |
| Add          | To **add** a field press a **+** icon. A new dialog will show up where you can select a type of field to add.         |
| Edit         | To **edit** a field press a **cog** icon near already added field. In this case that would be *First Name* field.     |
| Delete       | To **delete** a field press a **trash** icon near already added field. In this case that would be *First Name* field. |

### Field types

We provide many different field types that should satisfy any needs.

![Provided field types](https://760328771-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LwSkuCpTNI_AerL8J2a%2F-M-4af0ZcRHxRtkdV_1I%2F-M-4y-qd9bqigBiQiLJY%2Fcreate_collection_4.PNG?alt=media\&token=64553209-2949-4d51-aa32-aedd7748ff6d)

| Field        | Description                                                                                                                                                                                                                                                                                                                          |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Text         | <p>Text values.</p><p>This can be <strong>basic text</strong>, <strong>long text</strong> (multi-line basic text), <strong>translatable text</strong> (basic or long text with the ability to set for multiple languages), or <strong>HTML</strong>.</p>                                                                             |
| Number       | <p>Numeric values.</p><p>This can be <strong>integer</strong>, <strong>decimal,</strong> or <strong>currency</strong>.</p>                                                                                                                                                                                                           |
| Date         | <p>Date and time values.</p><p>This can be a <strong>date</strong> or <strong>date and time</strong>.</p>                                                                                                                                                                                                                            |
| Select       | <p>Value or values from a list. Used for static enumeration values or references to other resources.</p><p>This can be an <strong>enumeration</strong> (static values list), <strong>user(s) reference</strong>, <strong>role(s) reference</strong>, <strong>collection reference</strong>, <strong>taxonomy reference</strong>.</p> |
| Yes/No       | <p>Simple bool type value.</p><p>This can be <strong>true</strong> or <strong>false</strong>.</p>                                                                                                                                                                                                                                    |
| File         | <p>File field. Requires files module to be enabled.</p><p>This can be of type <strong>image</strong>, <strong>document,</strong> or <strong>any</strong>.</p>                                                                                                                                                                        |
| Email        | A special type of text field used for email addresses. Use this instead of the text field for email address validation and availability to send emails to addresses saved in this field.                                                                                                                                             |
| Web Link     | A special type of text field used for URLs. Use this instead of the text field for URL validation.                                                                                                                                                                                                                                   |
| Rating       | A special type of number field used for rating. Use this instead of the number field to display a rating selection in your record page and for rating validation.                                                                                                                                                                    |
| Nested Form  | <p>A list of objects. You can add any other field inside of the nested field.</p><p><strong>! Important</strong> - only one nested level is supported.</p><p><strong>! Important</strong> - nested form is provided as an array and not an object.</p>                                                                               |
| Geo Location | Latitude and longitude values.                                                                                                                                                                                                                                                                                                       |
| Tags         | A dynamic enumeration. Use this instead of the select field with enumerations, when you don't know all of the enumeration values from the start and want to add them on the go.                                                                                                                                                      |

## JSON schema

As said before, schema builder uses JSON schema internally which you can see or edit yourself.

![JSON and UI schema view](https://760328771-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LwSkuCpTNI_AerL8J2a%2F-M-5CfALwMPnIsBXgR9a%2F-M-5DPOk5vXlpNHo7ocM%2Fschema_2.PNG?alt=media\&token=7c168711-0ee0-420f-948b-c517161b895e)

* **JSON schema** - a schema that describes each of a field. Used for validation and display.
* **UI schema** - a schema that describes how each field should be rendered.

Although we provide schemas and allow you to edit them, we still recommend using a builder as builder fields use specific values to form a schema. Besides, editing your fields in the builder will reset your changes in JSON and UI schemas.&#x20;

{% hint style="warning" %}
**UI schema** should not be edited at all (unless you paste a schema previously generated by a builder) because each of a field requires specific values to be rendered correctly.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.codemash.io/dashboard/database/collections/schema.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
