Common field properties
All field types share these core properties:Additional common properties
Most fields also support:- Presentable - Hints the dashboard to use this field in record previews
- Required - Makes the field value mandatory (non-empty)
Field IDs are automatically generated when you add fields to a collection. They ensure stability even if you rename the field.
Text field
Stores string values with optional validation constraints.Properties
- Min - Minimum character length (0 = no limit)
- Max - Maximum character length (0 = default 5000)
- Pattern - Regular expression for validation
- AutogeneratePattern - Regex pattern for generating random values
- PrimaryKey - Mark as collection primary key (only for
idfield)
Special modifiers
Examples
- Username
- Slug
- Short description
Number field
Stores numeric values (stored as float64 internally).Properties
- Min - Minimum value (nil = no limit)
- Max - Maximum value (nil = no limit)
- OnlyInt - Restrict to integer values only
- Required - Require non-zero value
Special modifiers
Examples
- Price
- Quantity (integer)
- Rating
Email field
Stores and validates email addresses.Properties
- OnlyDomains - Whitelist of allowed email domains
- ExceptDomains - Blacklist of forbidden email domains
- Required - Require non-empty email
You can only use either
OnlyDomains or ExceptDomains, not both.Examples
- Basic email
- Corporate only
- Block disposable
URL field
Stores and validates URLs.Properties
- OnlyDomains - Whitelist of allowed domains
- ExceptDomains - Blacklist of forbidden domains
- Required - Require non-empty URL
Bool field
Stores true/false values.Properties
Only the common properties (Name, Required is not applicable as false is a valid value).Date field
Stores date and time values.Properties
- Min - Minimum date (RFC 3339 format)
- Max - Maximum date (RFC 3339 format)
- Required - Require non-empty date
Autodate field
Automatically sets date on create and/or update.Properties
- OnCreate - Set date when record is created
- OnUpdate - Update date when record is modified
Examples
- Created timestamp
- Updated timestamp
Select field
Stores single or multiple predefined values.Properties
- Values - List of allowed values
- MaxSelect - Max selections (1 = single, >1 = multiple)
- Required - Require at least one selection
Examples
- Single select
- Multiple select
JSON field
Stores arbitrary JSON data.Properties
- MaxSize - Maximum JSON size in bytes (default 2MB)
- Required - Require non-empty JSON
Example
Editor field
Stores rich text HTML content.Properties
- ConvertURLs - Auto-convert plain text URLs to links
- OnlyDomains - Whitelist of allowed domains in content
- ExceptDomains - Blacklist of forbidden domains
- Required - Require non-empty content
File field
Handles file uploads with validation.Properties
- MaxSelect - Max files (1 = single, >1 = multiple)
- MaxSize - Max size per file in bytes (default 5MB)
- MimeTypes - Allowed MIME types (empty = all)
- Thumbs - Thumbnail sizes for images
- Protected - Require token to access files
- Required - Require at least one file
Thumbnail formats
100x300- Crop to 100x300 from center100x300t- Crop to 100x300 from top100x300b- Crop to 100x300 from bottom100x300f- Fit inside 100x300 (no crop)0x300- Resize to 300px height, preserve aspect ratio100x0- Resize to 100px width, preserve aspect ratio
Special modifiers
Examples
- Profile picture
- Documents
- Product images
Relation field
Links to records in other collections.Properties
- CollectionId - ID of the related collection (required)
- MaxSelect - Max related records (1 = single, >1 = multiple)
- MinSelect - Min required relations
- CascadeDelete - Delete record if all relations are deleted
- Required - Require at least one relation
Special modifiers
Examples
- Single relation
- Multiple relations
- Self-referencing
Password field
Stores hashed passwords (auth collections only).Properties
- Min - Minimum password length
- Max - Maximum password length
- Pattern - Regex pattern for validation
- Required - Require non-empty password
Passwords are automatically hashed using bcrypt before storage. The plain text password is never stored.
Working with fields
Adding fields to collections
Adding at specific position
Removing fields
Getting fields
Field validation
Fields are validated when you save the collection:Helper functions
Common helper functions for working with field values:Best practices
- Validation
- Naming
- Performance
- Security
- Set appropriate min/max constraints
- Use patterns for format validation
- Mark fields as required only when necessary
- Provide sensible default values
Next steps
Base collections
Create your first collection
Auth collections
Add user authentication
Validation
Advanced validation techniques
API rules
Secure your data