Field Configuration

SettingsAnchor

Each field must have the following settings configured to be added to a model:

Property Description
Display name This is what is shown to content editors throughout the application
API ID This what is exposed within the API as a field within your model.
Description Displays a hint for content editors and API users.

OptionsAnchor

Not all options are available for all field types.

Use as a title fieldAnchor

You can set multiple fields as titles to appear within the relational picker instead of IDs.

You cannot use this when the field visibility is set to hidden, API only or read only.

Allow multiple valuesAnchor

You should select this if you wish to accept multiple values, and return an array to the API for this field.

You cannot use the title field with this option.

Localize fieldAnchor

Enabling this field allows translations per locale configured on your project.

You cannot use "Set initial value" with this option.

ValidationsAnchor

Not all validation options are available for all field types.

Make field requiredAnchor

Marking this prevents content from being saved if it is left empty. The API will mark this field as non nullable.

You cannot use this when the field visibility is set to hidden, API only or read only.

Set field as uniqueAnchor

Enabling this ensures content cannot be saved if the same value exists within another entry for this field.

Limit character countAnchor

This validation allows you to specify the minimum/maximum character counts. You can set At least, Between, and No more than, with a custom error message.

Match a specific patternAnchor

Thie validation allows you to only accept a specific regular expression.

Restrict a specific patternAnchor

This validation option allows you to restrict a speciifc regular express.

Both Match and Restricting patterns are defined by standard Regular Expressions (RegExp) and do not need to be wrapped in opening or closing slashes.

You can modify these pattern searches with additional flags such as ignoring case, enabling multi-line search, single-line search or both.

Common patternsAnchor

You can use an existing common pattern from the web app, or provide your own.

URL

(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)

Phone

^(?:(?:\(?(?:00|\+)([1-4]\d\d|[1-9]\d?)\)?)?[\-\.\ \\\/]?)?((?:\(?\d{1,}\)?[\-\.\ \\\/]?){0,})(?:[\-\.\ \\\/]?(?:#|ext\.?|extension|x)[\-\.\ \\\/]?(\d+))?$

Email

^([a-z0-9_\.\+-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$

Slug

^[a-z0-9]+(?:-[a-z0-9]+)*$

AdvancedAnchor

Not all advanced settings are available for all field types.

Set initial valueAnchor

You can define an initial value for content editors. This doesn't have any effect on the API when performing mutations.

You cannot use this when the field visibility is set to hidden, API only or read only.

Field visibilityAnchor

Option Description
Read / Write The field will be accessible for read/write operations. Default.
Read Only The field will be shown, but cannot be edited in the UI. You can update via the API if required.
Hidden The field will not be shown in the UI, but can be referenced by other fields such as Slugs, or UI Extensions.
API Only Field is not shown in the UI, but can be used via the API using mutations.

Field visibility has no relation with permissions or security.

Did you find this page useful?

Your feedback helps us improve our docs, and product.