ObjectStackObjectStack

Field Type Decision Tree

Interactive guide for choosing the right ObjectStack field type — decision flowchart, quick-reference table, and use case mapping

Field Type Decision Tree

Not sure which field type to use? Follow this decision tree to find the right type for your data, then check the quick-reference table for details.

Full Details: Once you've identified the right type, see the Field Type Gallery for complete configuration properties.


Decision Flowchart

flowchart TD
    START([What kind of data?]) --> TEXT{Text?}
    START --> NUM{Number?}
    START --> DATE{Date / Time?}
    START --> CHOICE{Choice / Selection?}
    START --> REL{Relationship?}
    START --> FILE{File / Media?}
    START --> COMP{Computed?}
    START --> STRUCT{Structured Data?}
    START --> AI{AI / ML?}

    %% Text branch
    TEXT -->|Short text| T1[text]
    TEXT -->|Long text| T2[textarea]
    TEXT -->|Rich formatting| T3[richtext]
    TEXT -->|Markdown content| T4[markdown]
    TEXT -->|Email address| T5[email]
    TEXT -->|Website URL| T6[url]
    TEXT -->|Phone number| T7[phone]
    TEXT -->|Secret value| T8[password]

    %% Number branch
    NUM -->|Any number| N1[number]
    NUM -->|Money amount| N3[currency]
    NUM -->|Percentage| N4[percent]
    NUM -->|Star rating| N5[rating]
    NUM -->|Slider input| N6[slider]

    %% Date branch
    DATE -->|Date only| D1[date]
    DATE -->|Date + time| D2[datetime]
    DATE -->|Time only| D3[time]

    %% Choice branch
    CHOICE -->|Single choice, dropdown| C1[select]
    CHOICE -->|Multiple choices| C2[multiselect]
    CHOICE -->|Single choice, visible| C3[radio]
    CHOICE -->|Multiple, visible| C4[checkboxes]
    CHOICE -->|On/off switch| C5[toggle]
    CHOICE -->|True/false| C6[boolean]

    %% Relationship branch
    REL -->|Reference another object| R1[lookup]
    REL -->|Parent-child cascade| R2[master_detail]
    REL -->|Self-referencing hierarchy| R3[tree]

    %% File branch
    FILE -->|Any file| F1[file]
    FILE -->|Image with preview| F2[image]
    FILE -->|User profile picture| F3[avatar]

    %% Computed branch
    COMP -->|Calculated value| K1[formula]
    COMP -->|Aggregate children| K2[summary]
    COMP -->|Auto-incrementing ID| K3[autonumber]

    %% Structured branch
    STRUCT -->|Postal address| S1[address]
    STRUCT -->|GPS coordinates| S2[location]
    STRUCT -->|Color picker| S3[color]
    STRUCT -->|Arbitrary JSON| S4[json]
    STRUCT -->|Sensitive secret value| S5[secret]

    %% AI branch
    AI -->|Vector embedding for semantic search| A1[vector]

    style START fill:#4f46e5,color:#fff
    style T1 fill:#059669,color:#fff
    style T2 fill:#059669,color:#fff
    style T3 fill:#059669,color:#fff
    style T4 fill:#059669,color:#fff
    style T5 fill:#059669,color:#fff
    style T6 fill:#059669,color:#fff
    style T7 fill:#059669,color:#fff
    style T8 fill:#059669,color:#fff
    style N1 fill:#d97706,color:#fff
    style N3 fill:#d97706,color:#fff
    style N4 fill:#d97706,color:#fff
    style N5 fill:#d97706,color:#fff
    style N6 fill:#d97706,color:#fff
    style D1 fill:#7c3aed,color:#fff
    style D2 fill:#7c3aed,color:#fff
    style D3 fill:#7c3aed,color:#fff
    style C1 fill:#dc2626,color:#fff
    style C2 fill:#dc2626,color:#fff
    style C3 fill:#dc2626,color:#fff
    style C4 fill:#dc2626,color:#fff
    style C5 fill:#dc2626,color:#fff
    style C6 fill:#dc2626,color:#fff
    style R1 fill:#0284c7,color:#fff
    style R2 fill:#0284c7,color:#fff
    style R3 fill:#0284c7,color:#fff
    style F1 fill:#be185d,color:#fff
    style F2 fill:#be185d,color:#fff
    style F3 fill:#be185d,color:#fff
    style K1 fill:#78716c,color:#fff
    style K2 fill:#78716c,color:#fff
    style K3 fill:#78716c,color:#fff
    style S1 fill:#0d9488,color:#fff
    style S2 fill:#0d9488,color:#fff
    style S3 fill:#0d9488,color:#fff
    style S4 fill:#0d9488,color:#fff
    style S5 fill:#0d9488,color:#fff
    style A1 fill:#6d28d9,color:#fff

Quick-Reference Table

Text Types

TypeUse WhenExample
textShort single-line input (names, titles)first_name, title
textareaMulti-line content without formattingdescription, notes
richtextFormatted content with HTML/WYSIWYGarticle_body, bio
markdownDeveloper-friendly formatted contentreadme, documentation
emailEmail address with validationemail, contact_email
urlWeb URL with validationwebsite, linkedin_url
phonePhone numberphone, mobile
passwordOne-way hashed credential (owned by auth subsystem)user_password
secretReversible encrypted-at-rest value, masked on readapi_key, db_password

Number Types

TypeUse WhenExample
numberAny numeric value (set precision/scale for decimals)price, weight, quantity
currencyMoney amounts with currency codeamount, total_price
percentPercentage values, stored as fractions 0–1 (0.85 = 85%)completion, discount
ratingStar ratings (typically 1–5)satisfaction, difficulty
sliderNumeric value via slider UIvolume, priority_level

Date & Time Types

TypeUse WhenExample
dateCalendar date without timebirth_date, due_date
datetimeFull timestamp with timezonecreated_at, meeting_start
timeTime of day without datestart_time, reminder_time

Choice Types

TypeUse WhenExample
selectPick one from a dropdown liststatus, category
multiselectPick multiple from a dropdowntags, skills
radioPick one, all options visiblepriority, size
checkboxesPick multiple, all visiblefeatures, permissions
toggleOn/off switch (UI-friendly boolean)is_active, notifications
booleanProgrammatic true/falseis_archived, email_verified

Relationship Types

TypeUse WhenExample
lookupReference another object (soft link)assigned_to → user
master_detailParent-child with cascade deleteline_item → order
treeSelf-referencing hierarchycategory → category

lookup vs master_detail: Use lookup when the child can exist independently. Use master_detail when deleting the parent should delete all children (e.g., order → line items).

File & Media Types

TypeUse WhenExample
fileFile upload (set multiple: true for many files)contract, documents
imageImage with preview/thumbnailproduct_photo, screenshots
avatarUser profile pictureavatar, profile_photo

Computed Types

TypeUse WhenExample
formulaValue calculated from other fieldsfull_name = first + last
summaryRoll-up aggregate from child recordstotal_amount = sum(items.price)
autonumberAuto-incrementing display IDticket_number: TICK-0001

Structured Data Types

TypeUse WhenExample
addressPostal address with componentsbilling_address, location
locationGPS coordinates (lat/lng)office_location, delivery_point
colorHex color value with pickerbrand_color, label_color
jsonArbitrary structured dataconfiguration, metadata
codeCode editor (JSON/SQL/JS)query_body, transform

AI & ML Types

TypeUse WhenExample
vectorHigh-dimensional embedding for similarity search (semantic search, RAG)content_embedding

Common Use Case Mapping

Can't find your use case above? Check this table:

Use CaseRecommended TypeWhy
User's full nametextShort, single-line, no validation needed
Blog post bodyrichtextNeeds formatting (bold, links, images)
Product pricecurrencyMoney needs currency code and decimal handling
Task assigneelookupReferences a user record
Invoice line itemsmaster_detailLines should cascade-delete with the invoice
Department hierarchytreeSelf-referencing parent → child
Feature flagsjsonArbitrary key-value configuration
User avatarimageSingle image with thumbnail support
Support ticket IDautonumberAuto-incrementing human-readable identifier
Total order valuesummaryRoll-up sum of child line item amounts
Discount percentagepercent0–100 range with % display
Terms acceptedbooleanSimple true/false, no UI toggle needed
Search indexvectorUsed for AI similarity search
OAuth tokensecretReversible value stored encrypted at rest

Decision Summary by Question

QuestionAnswer → Field Type
"Can the user type free text?"text, textarea, richtext, markdown, html
"Is it a number I need to calculate with?"number, currency, percent, slider
"Does the user pick from a list?"select, multiselect, radio, checkboxes
"Does it reference another record?"lookup, master_detail, tree
"Is it a file the user uploads?"file, image, avatar
"Is the value computed automatically?"formula, summary, autonumber
"Does it have internal structure?"address, location, color, json, code
"Is it sensitive/secret?"password, secret
"Is it for AI/ML?"vector

Still unsure? Start with text for strings or number for numerics. You can change the field type later, but ObjectStack does not auto-convert existing data: a small set of compatible narrowings (e.g. texttextarea/markdown/html/code, datedatetime) pass cleanly, while other type changes are rejected with a destructive_change error when you save the updated object — existing values may not convert cleanly. Re-submit the save with ?force=true to proceed anyway.

On this page