Skip to main content

Frappe Fieldtypes in Version 15

Complete, Developer-Friendly Technical Documentation**

Fieldtypes define what kind of data a DocField will store inside a DocType. In Frappe Framework v15, fieldtypes determine how data is captured, validated, rendered in UI, and processed by backend logic.
This documentation explains every standard fieldtype, its purpose, configuration rules, limitations, and usage patterns based strictly on Frappe v15.

What Are Fieldtypes in Frappe?

A Fieldtype is a data-type definition used inside a DocType to describe the structure, UI component, and behavior of a particular field.

Examples:

  • Data
  • Int
  • Float
  • Date
  • Select
  • Link
  • Table
  • Check
  • Currency
  • JSON
  • Code
  • Attach
  • Dynamic Link

Each fieldtype influences:

  • Database schema
  • Desk UI rendering
  • Form validation
  • REST API output
  • Permissions & filters

Complete List of Fieldtypes in Frappe v15

Below is the accurate, exhaustive list based on the Frappe v15 repository and official documentation.

1. Basic Fieldtypes

Data

Stores short text (varchar).

Example:

{"fieldname": "customer_name", "fieldtype": "Data"}

Usage: Names, labels, short strings.

Text

Stores long-form text.

Subtypes (handled through UI):

  • Text
  • Text Editor
  • Small Text
  • Long Text

Password

Masked field. Value is encrypted in DB.

Int

Integer values.

Float

Decimal values.

Currency

Stores currency with formatting.

Requires an optional currency field reference.

{"fieldname": "amount", "fieldtype": "Currency", "options": "currency"}

Percent

Specialized float formatted as percentage.

Check

Represents boolean (0/1).

2. Date & Time Fieldtypes

Date
Stores ISO date (YYYY-MM-DD).

Datetime
Stores date + time.

Time
Stores time only.

3. Selection Fieldtypes

Select

Predefined choices.

{
"fieldname": "priority",
"fieldtype": "Select",
"options": "High\nMedium\nLow"
}

4. Link and Relationship Fieldtypes

Link

Links to a record in another DocType.

{"fieldname": "customer", "fieldtype": "Link", "options": "Customer"}

Dynamic Link

The linked DocType depends on another field.

{"fieldname": "reference_name", "fieldtype": "Dynamic Link", "options": "reference_doctype"}

Table

Represents a child table.

{"fieldname": "items", "fieldtype": "Table", "options": "Sales Invoice Item"}

Table MultiSelect

Allows multi-row selection from another DocType.

Common in roles, tags, etc.

5. File & Media Fieldtypes

Attach
Uploads file and stores reference.

Attach Image
Displays uploaded image in form.

Image
Stores static images (not uploaded via Attach).

6. Code & Developer-Oriented Fieldtypes

Code
Used for scripts or JSON.
Supports syntax highlighting (JS, Python, HTML depending on options).

JSON
Stores JSON-encoded text.

Markdown Editor
Renders markdown preview.

HTML
Displays frontend-rendered HTML.
Does not store data; behaves as UI block.

Read Only
Displays a read-only value.
Not persisted (if marked virtual).

7. Miscellaneous Fieldtypes

Rating
Star rating component (0–5).

Color
Displays color picker.

Barcode
Generates/display barcodes.

Signature
Stores a digital signature (canvas-based input).

Geolocation
Captures latitude & longitude.

Duration
Stores formatted duration (HH:MM:SS).

Password
Encrypted & masked text.

Autocomplete
Provides dynamic suggestions via backend API.

8. Special Fieldtypes (Meta & Layout)

These fieldtypes do NOT represent data but UI/layout.

Section Break
Creates a UI section.

Column Break
Splits into UI columns.

Tab Break
Adds tabs to DocType form.

Fold
Folds/expands sections.

9. Composite Fieldtypes (Frappe-Specific)

Button
Triggers server/client action.

Heading
Large text heading (non-stored).

HTML Editor
WYSIWYG rich text editor.

Fieldtypes and Their Database Behavior

Fieldtype Stored in DB? Notes
Data ✅ Yes varchar
Int ✅ Yes int
Float ✅ Yes decimal
Currency ✅ Yes numeric with formatting
Select ✅ Yes stored as string
Link ✅ Yes stored as name
Dynamic Link ✅ Yes string reference
Table ✅ Yes (in child table) reference
HTML ❌ No UI only
Button ❌ No triggers action
Virtual Fields ❌ Not stored computed with Python

Code Examples (AEO Ready)

Example: Creating a Field Using JSON

{
"fieldname": "rating",
"label": "Customer Rating",
"fieldtype": "Rating"
}

Example: Table Field

{
"fieldname": "items",
"label": "Items",
"fieldtype": "Table",
"options": "Purchase Order Item"
}

Example: Dynamic Link

{
"fieldname": "document",
"fieldtype": "Dynamic Link",
"options": "doctype"
}

Best Practices for Using Fieldtypes

  • Choose the simplest fieldtype for your use-case
  • Avoid storing large text in Data (use Small Text or Long Text)
  • Use Dynamic Link only when business logic requires a variable target
  • Use JSON for structured configurations
  • Use Read Only + Virtual for computed Python properties
  • Avoid using HTML for storing data
  • Use Table fields when repeating rows are required

Troubleshooting Common Issues

Field not saving?

Check if it is:

  • A layout field
  • A virtual field
  • A computed field without DB mapping

Link autocomplete not working?

Ensure:

  • search_fields are defined
  • DocType has title_field or searchable columns
  • Permission rules allow read access

Currency not formatted?

Make sure:

  • “options” points to a valid currency field
  • Currency exists in Currency DocType

Cross-References for goerpnext.com

  • DocTypes in Frappe v15
  • Virtual DocFields
  • Customize Form
  • Client Scripts & Server Scripts
  • Meta and FieldJSON structure

Conclusion

Frappe Fieldtypes provide the building blocks for designing powerful, structured, and user-friendly DocTypes in ERPNext and custom Frappe apps. Understanding how each fieldtype behaves in the database, UI, and backend logic enables developers to build scalable, efficient, and clean data models.

Click to rate this post!
[Total: 0 Average: 0]