Question T7368
Visible to All Users

TEXTUAL EXPRESSION COLUMN CALCULATED ON CHOICE

created 4 years ago

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 …

Answers approved by surveyjs Support

created 4 years ago

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