Overview
TheConfigurableForm component (PF-17) provides a dynamic, configuration-driven form renderer that eliminates the need for hardcoded forms. It supports:
- Standard fields from entity table columns
- Custom fields from
pf_custom_field_definitions - Picklist-based selects from
pf_picklists - Lookup fields for entity references (accounts, customers, etc.)
- Field visibility based on roles and conditional rules
- Configurable layouts with sections and column spans
Quick Start
Basic Usage
Props
Field Types
Standard Field Types
The following types are supported inSTANDARD_FIELDS:
Adding Select Fields with Picklists
To use a picklist for a select field, addpicklistName to the field definition:
Adding Lookup Fields
Lookup fields reference other entities. Configure them inLookupFieldRenderer.tsx:
Database Configuration
Field Configs Table (pf_entity_field_configs)
Each visible field needs a config entry:
Custom Fields
Custom fields are automatically included when:- They exist in
pf_custom_field_definitionsfor the entity type - A config entry exists with
field_source = 'custom'
Migration Example
Converting an existing form to ConfigurableForm:Before (Hardcoded)
After (ConfigurableForm)
Fallback Behavior
If no field configs exist for an entity/context, ConfigurableForm falls back to rendering all fields fromSTANDARD_FIELDS in a default layout.
Best Practices
- Seed field configs for all view contexts - create_form, edit_form, detail_view, list_view
- Use meaningful section names - Groups fields visually in the UI
- Set column_span = 2 for full-width fields like textarea
- Configure conditional_rules for dependent field visibility
- Use picklists instead of hardcoded select options for flexibility