System: Platform Foundation (PF)Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
Feature: Picklist System (PF-15)
Created: 2025-01-27
Status: ✅ Complete
Quick Reference
When to Use Picklists:- ✅ You need dropdown values used across multiple forms/entities
- ✅ Values are organization-specific (vary by organization)
- ✅ Values change frequently (need to update without code)
- ✅ Values need to be managed by users (not developers)
- ❌ Values are form-specific → Use Form Options (FW-01)
- ❌ Values come from database table → Use Lookups (FW-15)
- ❌ Values are system constants → Use Enum (TypeScript)
- ❌ Values need strict type safety → Use Enum (TypeScript)
What Are Picklists?
Picklists are organization-scoped, user-manageable dropdown values that can be reused across forms, entities, and custom fields. They replace hardcoded enums and magic strings with flexible, customizable values. Key Characteristics:- Organization-scoped (each org has their own values)
- User-manageable (org admins can add/edit/delete)
- Reusable (used across multiple forms/entities)
- Versioned (track changes over time)
- Active/Inactive states (hide without deleting)
pf_picklists and pf_picklist_items tables
Common Use Cases
Use Case 1: Employment Status
Scenario: Your organization needs employment status dropdown (Full-Time, Part-Time, Contract, etc.) used in multiple places (employee forms, reports, filters). Solution: Create Picklist (PF-15) Why Picklists:- Used across multiple forms/entities
- Organization-specific (values may vary)
- User-manageable (add new statuses without code)
- Reusable (one picklist, many uses)
- Go to Settings → Picklists
- Create picklist:
- Name:
employment_status - Label: “Employment Status”
- Category: HR
- Name:
- Add items:
- Full-Time (value:
full_time) - Part-Time (value:
part_time) - Contract (value:
contract) - Temporary (value:
temporary)
- Full-Time (value:
- Use in forms/custom fields by referencing picklist name
- Values managed in one place
- Updates automatically across all uses
- No code changes needed
- Not form-specific (used across multiple forms)
- Not one-time use (reusable)
Use Case 2: Department Types
Scenario: Your organization categorizes departments (Operations, Clinical, Administrative) and needs this dropdown in multiple forms. Solution: Create Picklist (PF-15) Why Picklists:- Used across multiple forms/entities
- Organization-specific (categories may vary)
- User-manageable (add new categories)
- Create picklist:
department_types - Add items: Operations, Clinical, Administrative
- Use in forms/custom fields
- Not from database table (categories, not departments themselves)
- Static values (not dynamic from hr_departments)
Use Case 3: Priority Levels
Scenario: Your organization uses priority levels (Low, Medium, High, Critical) across workflows, forms, and tasks. Solution: Create Picklist (PF-15) Why Picklists:- Used across multiple systems (workflows, forms, tasks)
- Organization-specific (priority definitions may vary)
- User-manageable (add new priority levels)
- Create picklist:
priority_levels - Add items: Low, Medium, High, Critical
- Use in workflows, forms, custom fields
- Consistent priority values across system
- Easy to update (add “Urgent” without code)
When NOT to Use Picklists
❌ Don’t Use Picklists For: Form-Specific Options
Example: “I need Yes/No for this specific form question” Why Not Picklists:- Form-specific (not reusable)
- Simple binary choice (not worth picklist)
❌ Don’t Use Picklists For: Database Table Data
Example: “I need departments from hr_departments table” Why Not Picklists:- Data exists in database table
- Real-time data (departments added/removed dynamically)
- Needs to respect RLS policies
❌ Don’t Use Picklists For: System Constants
Example: “I need status values that never change (Active, Inactive)” Why Not Picklists:- System constants (same for all organizations)
- Need strict type safety
- Never change
type Status = 'active' | 'inactive'
Integration with Other Systems
Picklists + Custom Fields (PF-16)
Use Case: Custom field needs dropdown values Example: Employee shirt size (S, M, L, XL) Implementation:- Create picklist:
employee_shirt_sizes - Create custom field (PF-16):
- Entity: hr_employees
- Field Type:
select - Picklist: employee_shirt_sizes
- Field renders as dropdown with picklist values
- Reusable picklist values
- Consistent values across system
Picklists + Forms (FW-01)
Use Case: Form field needs dropdown values Example: Employment status in onboarding form Implementation:- Create picklist:
employment_status - In Form Builder, create select field
- Choose “Picklist” as data source
- Select picklist: employment_status
- Form renders with picklist values
- Values managed in one place
- Updates automatically across all forms
Picklists + Workflows (FW-03)
Use Case: Workflow condition needs dropdown values Example: Branch workflow based on priority level Implementation:- Create picklist:
priority_levels - In Workflow Builder, create condition
- Reference picklist values in condition
- Workflow branches based on priority
- Consistent values across workflows
- Easy to update (add new priority level)
Decision Tree
Examples by Category
HR Category
- Employment Status: Full-Time, Part-Time, Contract, Temporary
- Department Types: Operations, Clinical, Administrative
- Position Types: Manager, Staff, Contractor
- Credential Types: RN, LCSW, LPC, etc.
Finance Category
- Account Types: Asset, Liability, Equity, Revenue, Expense
- Invoice Status: Draft, Pending, Paid, Overdue
- Payment Methods: Check, ACH, Credit Card, Wire
Operations Category
- Priority Levels: Low, Medium, High, Critical
- Incident Types: Safety, Compliance, Maintenance
- Work Order Status: Open, In Progress, Completed, Cancelled
General Category
- Yes/No: Yes, No (if used across system)
- Boolean States: Active, Inactive
- Common Statuses: Pending, Approved, Rejected
Best Practices
1. Use Descriptive Names
✅ Do: Use descriptive names (employment_status, priority_levels)❌ Don’t: Use abbreviations (
emp_stat, prio)
2. Use Consistent Value Format
✅ Do: Use snake_case for values (full_time, part_time)❌ Don’t: Use mixed case (
Full-Time, part-time)
3. Add Metadata
✅ Do: Add colors, icons, descriptions to items❌ Don’t: Leave items without metadata
4. Use Categories
✅ Do: Organize picklists by category (HR, Finance, Operations)❌ Don’t: Create picklists without categories
5. Version Control
✅ Do: Track changes to picklists (versioning)❌ Don’t: Delete items (use is_active = false)
Common Mistakes
Mistake 1: Using Picklists for Database Table Data
Problem: Creating picklist for departments when hr_departments table existsSolution: Use Lookups (FW-15) to reference table
Mistake 2: Using Picklists for Form-Specific Options
Problem: Creating picklist for one form’s Yes/No questionSolution: Use Form Options (FW-01) - static options
Mistake 3: Not Using Picklists for Reusable Values
Problem: Manually typing employment status in each formSolution: Create picklist and reference in all forms
Mistake 4: Deleting Items Instead of Deactivating
Problem: Deleting picklist items (breaks historical data)Solution: Set is_active = false (preserves history)
Migration from Enums
When to Migrate Enum to Picklist
Migrate if:- Values vary by organization
- Values change frequently
- Users need to customize values
- Values used in multiple places
- Values are system constants
- Values never change
- Need strict type safety
Related Documentation
- PF-15: Picklist System Spec
- PF-16: Custom Field Definitions Spec
- Custom Fields Use Case Guide
- Clarity Analysis
Last Updated: 2025-12-05
Next Review: After user feedback