SurveyJS troubleshooting

SurveyJS clearInvisibleValues: when hidden answers still control logic.

Hidden does not always mean empty. Under answer-retention behavior, a question can disappear while its old value remains in survey data, and downstream visibleIf logic can continue reading it.

That behavior may be intentional. The defect is the mismatch between retention policy and form intent—not the existence of a particular setting by itself.

Diagnostic checklist

Work from the stored answer outward.

  1. 01

    Inspect both clearing settings

    Check the survey-level clearInvisibleValues value and any question-level clearIfInvisible override.

  2. 02

    Find readers of the hidden answer

    Trace visibleIf, enableIf, and requiredIf expressions that still depend on the source after an earlier answer can hide it.

  3. 03

    Reproduce the answer order

    The meaningful sequence is answer the source, change an earlier answer so the source hides, then inspect downstream behavior.

  4. 04

    Choose policy from intent

    Use onHidden or onHiddenContainer only when immediate clearing is desired. Clearing also means the old answer will not reappear if the question becomes visible again.

Example

The stale-answer shape

With onComplete, the source can hide while its value remains available to the reader. onHidden clears it immediately, but that is a product decision rather than a universal fix.

Retain until completion
{
  "clearInvisibleValues": "onComplete",
  "elements": [
    { "name": "source", "visibleIf": "{mode} = 'show'" },
    { "name": "reader", "visibleIf": "{source} = 'yes'" }
  ]
}
If immediate clearing is intended
{
  "clearInvisibleValues": "onHidden",
  "elements": [
    { "name": "source", "visibleIf": "{mode} = 'show'" },
    { "name": "reader", "visibleIf": "{source} = 'yes'" }
  ]
}

Honest boundary

What this guide and analyzer do not establish.

  • Connected replay uses witness-derived Boolean and enabled single-choice actions only.
  • Array-valued, text, rating, file, multi-page, completion, trigger-specific, and host actions are not generated.
  • Triggers may fire as side effects of replayed answers, but trigger and path coverage are not claimed.

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