SurveyJS troubleshooting

SurveyJS calculated value not working? Check every referenced name.

SurveyJS expressions can read questions, calculated values, and variables by name. After a rename or partial rewrite, a calculation can keep using an identifier the supplied definition no longer provides while the form itself still loads.

In one retained public-sector definition, total_general referenced A_total, B_total, and C_total even though none was defined. In the pinned SurveyJS runtime without host-injected variables, the displayed result stayed at 0% and “Crítico” while the definition’s actual section totals changed. FormPath can establish the missing references, but it cannot infer the intended replacement formula.

Diagnostic checklist

Work from the stored answer outward.

  1. 01

    Start with the displayed result

    Locate the expression question or calculated value behind the total, then trace every downstream percentage, category, HTML placeholder, and rule that reads it.

  2. 02

    Resolve every name in braces

    For each {name}, find the exact question, answer key, or calculated value supplied by the definition. Similar labels and differently named totals are not substitutes.

  3. 03

    Separate definition values from host variables

    Application code can inject variables at runtime. Confirm whether an absent name is truly stale or is deliberately supplied by the host before changing the formula.

  4. 04

    Validate, repair, and retest the chain

    Use expression validation and FormPath to identify unknown names, repair only from documented intent, then enter representative values and confirm every downstream output changes correctly.

Example

Three absent inputs left a final result stuck at zero

SurveyJS expression validation reports A_total, B_total, and C_total missing from the supplied definition. In the pinned SurveyJS runtime, changing the defined section totals still leaves the displayed result at 0% and “Crítico,” without a JSON load error. That confirms the broken references, not the intended replacement formula.

Retained grand-total expression
round({A_total} + {B_total} + {C_total}, 2)
What the supplied definition establishes
Defined totals:
  I_total_aspectos_administrativos
  II_total

Not defined:
  A_total
  B_total
  C_total

Needs owner confirmation:
  which totals belong in total_general

Honest boundary

What this guide and analyzer do not establish.

  • A missing name can be a deliberate host-injected variable; FormPath’s structural conclusion is about the supplied definition.
  • The analyzer does not infer replacement fields, reconstruct the intended formula, or decide whether a resulting score is substantively correct.
  • A repaired expression still needs representative-answer testing, downstream output review, and any host-application validation the form requires.

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