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

# Zite Database Field Types

> Complete reference for all available field types and their configurations.

The 28 field types you can create through the REST API: their `type` string, value shape, and key settings (defaults in parentheses). Every key setting is optional, except where marked required.

| Type | Value | Key settings (defaults) |
| - | - | - |
| **Text** `single_line_text` | `string` | — |
| **Long Text** `long_text` | `string` (multi-line) | — |
| **Rich Text** `rich_text` | `string` (formatted text) | — |
| **Email** `email` | `string` (not format-checked on write) | — |
| **URL** `url` | `string` (not format-checked on write) | — |
| **Phone** `phone_number` | `string` (any formatting) | — |
| **Number** `number` | `number \| null` | `decimalPlaces` 0–10 (1), `numberFormat` (local) ¹ |
| **Currency** `currency` | `number \| null` (raw number) | `currencySymbol` (\$), `decimalPlaces` 0–10 (2), `numberFormat` (local) ¹ |
| **Percent** `percent` | `number \| null` (decimal; `0.5` = 50%) | `decimalPlaces` 0+ (0), `numberFormat` (local) ¹, `showProgressBar` (false), `allowNegative` (false) |
| **Rating** `rating` | `number \| null` (int 0–maxRating; the API doesn't enforce the max) | `maxRating` 1–10 (5) |
| **Duration** `duration` | `number \| null` (total seconds) | `format` (h:mm) ² |
| **Single Select** `single_select` | `string \| null` (option label) | `options[]` of `{ label, color? }` ³ |
| **Multiple Select** `multiple_select` | `string[]` (labels) | `options[]` of `{ label, color? }` ³ |
| **Checkbox** `checkbox` | `boolean` | `defaultValue` (none) |
| **Date** `date` | `string \| null` (ISO date, UTC) | `dateFormat` (local) ⁴ |
| **DateTime** `datetime` | `string \| null` (ISO datetime) | `displayTimeZone` (false), `dateFormat` (local) ⁴, `timeFormat` (12h) ⁵, `timezone` (browser) |
| **Attachments** `attachments` | Read: `Array<{ url, filename }>` (files uploaded in the app can also carry `originalName`, `size`, `mimeType`, `uploadedAt`). Write: an array of URLs or `{ url, filename? }` | None (URLs must be publicly reachable; `filename` is display-only) |
| **Linked Record** `linked_record` | `string[]` (record IDs) | `tableId` (required), `allowMultiple` (true) ⁶ |
| **Lookup** `lookup` | `any \| any[] \| null` (looked-up values, read-only) ⁷ | `linkedRecordFieldId` (required), `lookupFieldId` (required) ⁸ |
| **Rollup** `rollup` | Aggregated value, shape follows `resultType` (read-only) | `linkedRecordFieldId` (required), `rollupFieldId` (required), `aggregationFormula` (required, e.g. `SUM(values)`), `resultType?`, `formatting?` ⁸ |
| **Formula** `formula` | `string \| number \| Date \| boolean \| any[]`, shape follows `resultType` (read-only) | `expression` (required), `resultType` (inferred if omitted), `formatting?`. See [Formula fields](#formula-fields) |
| **Autonumber** `autonumber` | `number \| null` (auto-assigned, read-only) | — |
| **Source** `source` | JSONB union, system-set (read-only) ⁹ | None, but send `"template": {}` when creating it |
| **Created At** `created_at` | `string` (ISO datetime, read-only) | `displayTimeZone`, `dateFormat` ⁴, `timeFormat` ⁵, `timezone` |
| **Updated At** `updated_at` | `string` (ISO datetime, read-only) | `displayTimeZone`, `dateFormat` ⁴, `timeFormat` ⁵, `timezone` |
| **Created By** `created_by` | `string \| null` (user ID, read-only) | — |
| **Updated By** `updated_by` | `string \| null` (user ID, read-only) | — |
| **User** `user` | `string[]` (user IDs, up to 100) | `allowMultiple` (false), `internalOnly` (false), `deleteRowWhenUserDeleted` (false) ¹⁰ |

**Notes**

1. `numberFormat`: `local` (default) · `comma_period` · `period_comma` · `space_comma` · `space_period` · `no_separator`.
2. Duration `format`: `h:mm` (default) · `h:mm:ss` · `h:mm:ss.s` · `h:mm:ss.ss` · `h:mm:ss.sss`.
3. `options[]`: `label` required; `color` optional (auto-assigned if omitted); `value` optional, so omit it when creating. On update, options merge into the existing ones; see [Update Field](https://developers.zite.com/api/fields/update-field.md#select-options). Colors: purple, orange, blue, gray, red, yellow, green, pink, lime, tangerine, emerald, sky, teal, indigo, cyan, violet, fuchsia.
4. `dateFormat`: `local` (default) · `long` · `us` · `european` · `iso`.
5. `timeFormat`: `12h` (default) · `24h`.
6. `tableId` takes a table ID. When you create a database or a table, it also accepts the name of a table in that database; [Create Field](https://developers.zite.com/api/fields/create-field.md) takes IDs only. Creating the field auto-connects both tables in both directions.
7. Single value if the linked-record field has `allowMultiple: false`, array if `true`; element type matches the looked-up field.
8. Lookups and rollups can't be created while creating a database or table. Add them afterwards with [Create Field](https://developers.zite.com/api/fields/create-field.md). `linkedRecordFieldId` and `lookupFieldId`/`rollupFieldId` take field IDs.
9. `{ type: "public_api", apiKeyId? }` | `{ type: "form_submission", flowPublicId, sessionId }` | `{ type: "workflow", workflowId, executionId }` | `{ type: "manual", reason?, userId? }` | `null`.
10. With `allowMultiple: false` the value is still an array, capped at one ID. `internalOnly` only limits the picker in the app UI to organization members. `deleteRowWhenUserDeleted` deletes the record when its user is removed, and only applies when `allowMultiple` is off.

## Formula fields

Formula fields compute their value from other fields using a formula expression. They are read-only and automatically recalculate when referenced fields change. See the [Formulas guide](https://zite.com/help/database/configure-database/formulas) for the complete list of supported functions.

```json theme={"system"}
{
  "name": "Total Price",
  "type": "formula",
  "template": {
    "expression": "SUM({Price}, {Tax})",
    "resultType": "number",
    "formatting": {
      "numberDisplayType": "currency",
      "decimalPlaces": 2
    }
  }
}
```

| Property | Type | Description |
| - | - | - |
| `expression` | string | The formula expression, e.g. `"SUM({Price}, {Tax})"` |
| `resultType` | string | Optional output type: `"text"`, `"number"`, `"date"`, `"boolean"`, or `"array"`. Inferred from the expression when omitted |
| `formatting` | object | Optional display formatting (see below) |

**Formatting options**

* Numbers use `numberDisplayType`: `"number"` (plain) · `"currency"` (use with `decimalPlaces`, `numberFormat`) · `"percent"` · `"duration"`.
* Dates use `dateFormat`, `timeFormat` (`"12h"` or `"24h"`), `timezone`, `displayTimeZone` (whether to show the timezone).

## Primary field

The first field in each table is the **primary field** and must be one of: `single_line_text`, `long_text`, `date`, `datetime`, `phone_number`, `email`, `url`, `number`, `currency`, `percent`, `duration`, `autonumber`, `formula`.

## Empty values

| Value kind | Empty value |
| - | - |
| Text | `""` |
| Number | `null` |
| Boolean | `null` when never set, otherwise `false` |
| Array | `[]` or `null` (select, attachments) |
| Object | `null` |

> [!WARNING]
>
> Changing a field's type after data exists can cause data loss if the new type is incompatible with existing values.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.