Validation and Form State

“Validation” is not one operation in the SDK. Each validator protects a different boundary:

BoundaryValidatorFailure shape
Declaration integritycreateSchema()Throws for contradictory or inapplicable rules
One code-defined fieldvalidateFieldValue(){ valid, value, error? }
One measurementvalidateAndResolveMeasurement(){ valid, value?, error? }
A published BusinessDash form payloadvalidateFormSubmission(){ ok, issues }
Current dashboard-form runtimecreateFormController().validate()MissingField[] and updated controller errors
Live receiving contractBusinessDash servervalidation_failed and field issues

Rules are definitions; errors are state

const budget = bd.number().validate({
  greaterThan: 0,
  lessThan: 1000000,
  round: 2,
})

The rule object is stable metadata. An error such as “Budget must be less than 1,000,000” exists only after a particular value is checked. Store that error with the visitor's current form state, not by mutating the schema.

field definition + current value + sibling context
                         │
                         ▼
                     validator
                         │
              ┌──────────┴──────────┐
              ▼                     ▼
       normalized value       current error

round and floor are also normalizers, so a successful validateFieldValue() result may contain a different value.

Required, conditional, and visible

  • .required() describes schema nullability.
  • notNull rejects an empty value in validateFieldValue().
  • requiredIf requires one field from sibling-value context.
  • ConditionalBlock controls whether an entire render subtree is eligible to appear.

Those concepts can cooperate, but none is a substitute for another. A hidden branch should generally be omitted from active validation and submission by the runtime that owns the branch state.

Client and server

Client validation gives immediate feedback and avoids unnecessary requests. The Live server schema is still authoritative because it may have changed after the client loaded.

Always handle validation_failed, even after local validation passed.

For exact rule syntax, continue to Schema Validation.