Fields
Fields define the structure of data within your CMS collections. Add text fields, numbers, dates, references to other collections, and more to create rich content structures.
When to use
Use Fields tools to:
- Add custom fields: Define what data each collection item contains
- Create relationships: Link collections with reference fields
- Configure field options: Set up dropdowns, checkboxes, and radio buttons
- Update field settings: Modify existing field configurations
- Structure content: Define required vs. optional fields
Tool details
Tool name: data_cms_tool
Available actions
Create static field
Add static field types like text, numbers, dates, and more to a collection.
Action: create_collection_static_field
Parameters:
Request object:
Example usage:
Create option field
Add a field with predefined choices (dropdown, radio, checkbox).
Action: create_collection_option_field
Parameters:
Request object:
Example usage:
Use option fields for consistent, controlled values like categories, statuses, or priority levels.
Create reference field
Create a field that links to items in another collection.
Action: create_collection_reference_field
Parameters:
Request object:
Example usage:
Reference fields create relationships between collections, allowing you to link related content without duplicating data.
Update field
Modify properties of an existing field.
Action: update_collection_field
Parameters:
Updatable properties:
- Display name
- Help text
- Required status
- Validation rules
- Default values
Example usage:
Best practices
Plan field structure in advance
Before adding fields:
- List all data points you need
- Determine which are required vs. optional
- Identify relationships between collections
- Consider validation requirements
This prevents restructuring later.
Use clear, descriptive names
Display names: Human-readable
- ✅ “Featured Image”, “Publish Date”, “Author Name”
- ❌ “img1”, “date”, “person”
Slugs: Code-friendly
- ✅ “featured-image”, “publish-date”, “author-name”
- ❌ “Image1”, “Date”, “author name”
Document reference relationships
When using reference fields, document:
- Which collections link to which
- Whether references are required
- How many items can be referenced
- What happens if referenced item is deleted
This helps maintain data integrity.
Limitations
- Field types: Cannot change field type after creation
- Deletion: Deleting a field deletes all data in that field
- Slug changes: Field slugs cannot be changed after creation
- No Validation: You cannot set validation rules for fields via the API
Deleting a field permanently removes all data stored in that field across all collection items. Export data before deletion if needed.