survey-creator
survey-creator copied to clipboard
Ability to have different choices per matrixdynamic columns seems to have broken
Are you requesting a feature, reporting a bug or ask a question?
Reporting bug
What is the current behavior?
I had created a Survey in Survey-Creator that at one time allowed me to have different dropdown choices per column on a single Dynamic Matrix object. This no longer seems to be possible which may have something to do with survey library itself and a code change on that end. When attempting to add different choices between columns, Survey Creator does not respect the values:
Choices for column one, "Sex":

Choices for column two, "Age":

JSON output when apply is made on both of these columns:

Trying to add the data in the actual choices field in right-hand sidebar does not work as this makes the choices global for all columns.
What is the expected behavior?
Differentiating the choice data between columns used to work reliably, but now the JSON will not output to two columns, nor are any choices available when attempting to preview or run the survey in the wild..
Code that used to work now throws error in Creator JSON output:

How would you reproduce the current behavior (if this is a bug)?
- Drag a dynamic matrix block into your Survey Creator page
- Make 2 columns
- Hover over the pencil Icon on one column and add choices, click Apply
- Hover over the pencil icon on the other column and add different choices, click Apply
- Observe that either one set of choices becomes global for all, or no choices persist and JSON choices does not output
Provide the test code and the tested page URL (if applicable)
Code that used to work:
{
"logoPosition": "right",
"pages": [
{
"name": "page1",
"elements": [
{
"type": "matrixdynamic",
"name": "child_sex&age",
"visibleIf": "{Parent} = 'Yes'",
"title": "Please select your child's biological sex and current age (in years)",
"columns": [
{
"name": "Age",
"choices": [
{
"value": "item1",
"text": "Prefer not to Answer"
},
{
"value": "item2",
"text": "Under 12 Months"
},
{
"value": "item3",
"text": "1"
},
{
"value": "item4",
"text": "2"
},
],
"storeOthersAsComment": true,
"optionsCaption": "Choose "
},
{
"name": "Sex",
"choices": [
{
"value": "item1",
"text": "Prefer not to Answer"
},
{
"value": "item2",
"text": "Male"
},
{
"value": "item3",
"text": "Female"
},
{
"value": "item4",
"text": "Intersex"
}
],
"storeOthersAsComment": true,
"optionsCaption": "Choose "
}
],
"optionsCaption": "Choose ",
"rowCount": 1,
"minRowCount": 1,
"confirmDelete": true,
"confirmDeleteText": "Are you sure you want to delete this record?",
"addRowText": "Add Child"
}
]
}
]
}
Specify your
- browser: Firefox 102.0
- editor version: 1.940
We will investigate the problem and write back as soon as possible
@stephenmond hello, I am sorry for the late answer.
It seems that we did some updates for that functionality in matrix dynamic:

Could you please check it at https://surveyjs.io/create-free-survey ? Possibly the problem doesn't exist anymore.