viaSocket Help

Visibility Condition

Control field visibility dynamically to create cleaner, context-aware forms.

#

Implementation

Use a conditional expression to determine when a field should appear in the UI.

Expression Syntax:

"visibilityCondition": "form.field_key == 'value'"
#

Common Patterns

Scenario

Condition Logic

Dropdown Selection

form.type == 'manual'

Boolean Toggle

form.enable_advanced == true

Multiple Conditions

form.type == 'custom' && form.source == 'api'

#

Best Practices

  • Avoid Nested Logic: If you find yourself writing complex, multi-layered conditions, consider breaking the form into an Input Group or separate steps.

  • Default States: Ensure your fields have clear default values so the form doesn't look "broken" when a visibility condition is initially false.

  • Performance: Visibility conditions are evaluated on every input change; keep the expressions simple to ensure a responsive UI.

💡 Pro-Tip: Always test your visibility conditions in the Preview tab of the builder. Verify that all required fields within a hidden group are handled correctly when the parent condition is toggled.