In survejs in a field of type "matrix multiple choice" I have a column "A" of type "dropdown", with the possibility of choosing values from 0 to 6. It is possible to insert an additional column in which according to the choice made does a certain text appear in column "A"? For example, if in column "A", line 1 I choose "0" then "Text X" appears, instead if in column "A", line 2 I choose "3" then "Text T" appears …
TEXTUAL EXPRESSION COLUMN CALCULATED ON CHOICE
Answers approved by surveyjs Support
Hello,
You can add an expression column and calculate text in expression:
JSON{
"pages": [
{
"name": "page1",
"elements": [
{
"type": "matrixdynamic",
"name": "question1",
"columns": [
{
"name": "Column 1"
},
{
"name": "Column 2",
"cellType": "expression",
"expression": "iif({row.Column 1} = 1, 'Text 1', 'Text 2')"
}
],
"choices": [
1,
2,
3,
4,
5
]
}
]
}
]
}
as described in documentation - https://surveyjs.io/Documentation/Library?id=LibraryOverview#conditions-expressions
Thanks, Serge
SurveyJS Team