Concepts
Engine
Schema-first
A form0 schema is a JSON document with a top-level form object. The schema defines the
structure, rules, and behavior of a form without any UI code.
Fields and values
- Each field has a
data_name(human-readable identifier) and akey(internal identifier, typically derived fromdata_name). - Engine values are stored by
data_name. - Conditions reference fields by
field_id. You can use eitherkeyordata_name; usingdata_nameis often more practical when writing schemas manually since it's more memorable.
Engine state
The engine evaluates the schema and produces a state object with:
values: current field valueserrors: validation errorsvisible: visibility flags per fieldrequired: requirement flags per fieldread_only: read-only flags per field
Data flow
- Load the schema and create the engine
- Provide initial values (optional)
- Fire any initialization events
- Evaluate: calculations, conditions, and validation
- On each value change:
- Update the value
- Re-evaluate (live validation)
- Fire change events if defined
- Read state or build a structured record for submission
Events and expressions
- Calculated fields use expressions, inside
calculateproperty, like$age + 1to derive values from other fields. - Events live in
form.events.codeand can react to form changes at runtime (e.g., when a record is loaded or a field changes).
Last modified on