SurveyJS troubleshooting

SurveyJS visibleIf not working? Debug the expression systematically.

SurveyJS parses visibleIf as a Boolean expression and re-evaluates it when referenced values change. The most expensive failures are syntactically valid rules that are permanently false: the form loads, no exception appears, and a field silently disappears for every respondent.

The fastest path is to compare the expression with the answer values the definition actually stores before stepping through application code.

Diagnostic checklist

Work from the stored answer outward.

  1. 01

    Check braces and names

    Use {questionName} for an answer reference. Then verify the name or valueName still exists after recent renaming.

  2. 02

    Inspect values and types

    Compare against choice values rather than display text, preserve exact spelling, and check whether the form stores a string, number, Boolean, or array.

  3. 03

    Use the right array operator

    For multi-select answers, contains tests membership. Equality describes an exact selection and behaves differently.

  4. 04

    Follow inherited and external conditions

    Panel and page rules, choices loaded while the app runs, variables, and custom functions can control a question even when its visibleIf looks correct on its own.

Example

A harmless-looking typo that creates a dead branch

This is a synthetic example. The first rule is valid syntax, but “residental” is not an offered answer value. For supported finite domains, FormPath can distinguish that impossible rule from a branch that merely needs a particular answer.

Synthetic failing rule
{
  "choices": ["residential", "investment"],
  "visibleIf": "{propertyUse} = 'residental'"
}
Rule using an offered value
{
  "choices": ["residential", "investment"],
  "visibleIf": "{propertyUse} = 'residential'"
}

Honest boundary

What this guide and analyzer do not establish.

  • FormPath supports a finite subset of SurveyJS expression semantics, not every built-in or custom function.
  • Reachability fixtures are answer states and do not claim exhaustive branch, path, trigger, or navigation coverage.
  • The report identifies unsupported expressions and work-budget limits instead of presenting silence as success.

No signup · no upload

Ask which supported answer states are actually possible.

FormPath runs locally and exports each finding, how it was checked, and any important limits as JSON or Markdown.

Check a SurveyJS form