Skip to content
On this page

Directus Cloud

Everything you need to start building. Provisioned in 90 seconds. Starting at $15/month.

Get Started

Fields

Fields are database columns. Fields also enable you to manage the backend logic (such as conditional display logic, input verification rules, etc.) and frontend design used to display its data (e.g., whether data will display in a table or on a map).

Overview

To access a collection's fields, navigate to Settings > Data Model > [Collection]. From here, you can click a field to access its Configuration Drawer and make advanced configurations. You also have the following controls for each field.

Fields and Layout — Create, view, and configure a collection's fields as well as adjust how they are displayed and ordered on the Item Details Page. This section also provides access to the Field Context Menu and Field Configuration Drawer, described below.

Field Context Menu more_vert — Contains the following controls:

  • edit Edit Field — Opens the Field Configuration Drawer.
  • content_copy Duplicate Field — Duplicates a field along with all of its configuration options.
  • visibility_off Hide Field on Detail — Toggle field visibility on the Item Detail Page for Admin Users.
  • Width — Fields have three different width options:
    • border_vertical Half Width — The field input is shown at half the form width.
    • border_right Full Width — The default. The field input is shown at the full form width.
    • aspect_ratio Fill Width — The field input is shown filling the full width of the page area.

The Field Configuration Drawer — Provides all field configuration options.

Create a Field (Standard)

To make field configuration as intuitive and easy as possible, a template wizard is provided so that you can create fields pre-configured for common use-cases. When you create a field this way, you will still have full power to configure the field as desired.

  1. Navigate to Settings > Data Model > [Collection].
  2. Under Fields & Layout, click the Create Field button.
    A side drawer will open, with various pre-configured Interfaces to choose from.
  3. Click to select the desired field and a basic configuration menu will open.
  4. Add a Field Key, which is also used as the default field name.
    Optional: Configure the other field details as desired.
    Optional: Click Continue in Advanced Field Creation Mode.
  5. When you are ready, click Save to confirm.

Create a Field (Advanced)

This field creation method opens the Field Configuration Drawer so you can customize every field detail from the start. To create a field in advanced mode, follow these steps.

  1. Navigate to Settings > Data Model > [Collection Name].
  2. Under Fields & Layout, click the Create Field in Advanced Mode button.
    A dropdown menu will appear with various field types to choose from.
  3. Click to choose the field type and the Field Configuration Drawer will open.
  4. Configure your field as desired.
  5. Click check to confirm.

Database Columns

Remember, a field is a database column. Therefore, you can create a column directly in the database and it will automatically appear within Directus. You can then enhance the experience further by configuring it as desired.

Configure a Field

Fields are configured in the Field Configuration Drawer, which is composed of eight sections. These provide extensive customization options, from the database column's details, to how it is displayed and interacted with, and even custom input validation and conditional display logic. To configure a field, follow these steps.

  1. Navigate to Settings > Data Model > [Collection Name].
  2. Under Fields & Layout, click the field you want to update.
    The Field Configuration Drawer will open.
  3. Navigate to one of these sections and configure the field as desired:
    • Schema — Defines the database column schema for the field.
    • Relationship — Controls and only appears when configuring relational field details.
    • Translations — Controls and only appears when configuring translation field details.
    • Field — Sets details for the field input, which is displayed on the item page.
    • Interface — Configures how you interact with the field's values.
    • Display — Configures how field values are displayed in the Data Studio.
    • Validation — Creates a filter to determine valid user input.
    • Conditions — Alters the current field's setup based on the values of other fields.
  4. Click check to confirm.

Fields in System Collections

While all out-of-the-box fields within system collections are locked from configuration or deletion, you are able to create new fields within system collections.

Duplicate a Field

To duplicate a field, follow these steps.

  1. Navigate to Settings > Data Model > [Collection Name].
  2. Click the more_vert icon for the field you want to duplicate.
  3. Click the content_copy Duplicate Field option.
  4. Choose the collection you'd like to create the field in and set the Field Name.

Relational and Primary Key Fields

Currently, it is not possible to duplicate relational fields or a collection's primary key.

Duplicates Configurations Only

When you duplicate a field, all of its configuration settings will be copied as well. However, values stored within that field will not be copied.

Toggle Field Visibility (for Admins)

For users with any non-admin role, a field's visibility can be adjusted via access permissions. However, you may want to hide certain fields for admins as well. This is handy if the field is distracting or has no need to be seen on the item details page.

Adjust Field Width

Adjusting the field width in Fields and Layout will change field width on the Item Detail Page. To adjust field width, follow these steps.

  1. Click more_vert to open the field's context menu.
  2. Choose one of the following:
    • border_vertical Half Width — The field is shown at half the form width.
    • border_right Full Width — The default. The field is shown at the full form width.
    • aspect_ratio Fill Width — The field is shown filling the full width of the page area.

Manually Sort Fields

Adjusting the field order in Fields and Layout will change its order on the Item Page. To manually sort fields, click drag_indicator to drag and drop the field as desired.

Delete a Field

To permanently delete a field and all its stored values, follow these steps.

  1. Navigate to Settings > Data Model > [Collection Name].
  2. Click the more_vert icon for the field you want to delete.
  3. Click the delete Delete Field option.
  4. Confirm this decision by clicking Delete in the dialog.

Irreversible Change

This action is permanent and cannot be undone. Please proceed with caution.