Skip to main content
Conditional logic is evaluated automatically by @osforms/react as the user fills out the form. Hidden fields are skipped in navigation and excluded from the submission payload.

Types

Usage in FormField

How the SDK evaluates conditions

The @osforms/react SDK evaluates conditions in real time using the isFieldVisible utility:
Evaluation rules:
  • equals / not_equals — strict string comparison after coercion (String(value))
  • contains / not_contains — substring check on stringified value
  • greater_than / less_than — numeric comparison after Number() coercion
  • is_emptyundefined, null, or empty string
  • is_not_empty — any other value
  • match: 'all' — every condition must be true (AND)
  • match: 'any' — at least one condition must be true (OR)

Accessing visible fields

When using useFormState directly, visibleFields reflects the current set of visible fields after applying all conditional logic:
Hidden fields are automatically filtered out of visibleFields and are not included in the submission payload. For full conditional logic documentation, see Core / Conditional Logic.