less than 1 minute read

Here’s something I discovered while building a survey service with SurveyJS.

When you create JSON with the Survey Builder, each question has a property called visibleIf. If it’s “true”, the question is shown on screen; if it’s “false”, it isn’t.

It’s not a boolean true/false.

It’s a string “true”/”false”.

So you need to write your JSON like this:

{
    // omitted
    "type": "checkbox",
    "name": "Q1",
    "title": "test quesition",
    "isRequired": true,
    "visibleIf": "false", // since it's "false", this question is not shown
    "choices": [
        "item1",
        "item2",
        "item3"
    ],
    // omitted
}

Tags:

Categories:

Updated:

Leave a comment