Question T5359
Visible to All Users

Copy Data in Matrix Dropdown

created 4 years ago (modified 4 years ago)

Hi,
When i try to get the data through Copy Value in the Matrix Dropdown from Matrix Dropdown i am unable to do so. As the fields from Matrix dropdown are not shown in the list of Copy value. I want the data entered in Q11b to get copied in Q29a. And i also want to disabled one Column in Q29b. Below is the sample json.

{
"pages": [
{
"name": "pg_Q11b",
"elements": [
{
"type": "matrixdropdown",
"name": "Q11b",
"title": "Q11b. And could you please indicate the share of prescription of the therapies that you prefer to prescribe to your 1st line mCRPC patients?",
"validators": [
{
"type": "expression",
"text": "TOTAL SHOULD ADD TO 100",
"expression": "{Q11b-total.Share}=100"
}
],
"rowsVisibleIf": "{Q11a} contains {item}",
"columns": [
{
"name": "Share",
"title": "Share of Prescription",
"isRequired": true,
"totalType": "sum"
}
],
"choices": [
1,
2,
3,
4,
5
],
"cellType": "text",
"rows": [
{
"value": "A",
"text": "Abiraterone"
},
{
"value": "B",
"text": "Enzalutamide"
},
{
"value": "C",
"text": "Abiraterone + Taxane (Docetaxel / Cabazitaxel)"
},
{
"value": "D",
"text": "Taxane (Docetaxel / Cabazitaxel) monotherapy "
},
{
"value": "E",
"text": "Other Chemotherapy"
},
{
"value": "F",
"text": "{Q11a_Others1}"
},
{
"value": "G",
"text": "{Q11a_Others2}"
}
],
"totalText": "Total :"
}
]
},
{
"name": "pg_Q29a",
"elements": [
{
"type": "matrixdropdown",
"name": "Q29a",
"title": "Q29a. Doctor, now that you have gone through the Product X concept note, would like to show you the grid on the prescription share which you have filled earlier for 1st line mCRPC patients. Please look at the grid below to see if you want to re-allocate your prescription share of the existing therapies with the introduction of Product X to your 1st line mCRPC patients?",
"validators": [
{
"type": "expression",
"text": "TOTAL SHOULD ADD TO 100",
"expression": "{Q29a-total.Share_A} = 100"
}
],
"columns": [
{
"name": "Q11b_Data",
"title": "Q11b"
},
{
"name": "Share_A",
"title": "Share",
"isRequired": true,
"totalType": "sum"
}
],
"choices": [
1,
2,
3,
4,
5
],
"cellType": "text",
"rows": [
{
"value": "1",
"text": "Abiraterone",
"visibleIf": "{Q11a} contains 'A'"
},
{
"value": "2",
"text": "Enzalutamide",
"visibleIf": "{Q11a} contains 'B'"
},
{
"value": "3",
"text": "Abiraterone + Taxane (Docetaxel / Cabazitaxel)",
"visibleIf": "{Q11a} contains 'C'"
},
{
"value": "4",
"text": "Taxane (Docetaxel / Cabazitaxel) monotherapy ",
"visibleIf": "{Q11a} contains 'D'"
},
{
"value": "5",
"text": " Other Chemotherapy",
"visibleIf": "{Q11a} contains 'E'"
},
{
"value": "98",
"text": "{Q11a_Others1}",
"visibleIf": "{Q11a} contains 'F'"
},
{
"value": "99",
"text": "{Q11a_Others2}",
"visibleIf": "{Q11a} contains 'G'"
},
{
"value": "X",
"text": "Product X"
}
],
"totalText": "Total : "
}
],
"title": "SECTION C: Perception About Product X in the Management of mCRPC Patients (~10 Mins)"
{
"name": "pg_Last",
"elements": [
{
"type": "html",
"name": "Lastpage",
"html": "<br /> <br /> <br /> <H2><center>Click on Complete to Submit the Survey</center></H2>"
}
]
}
],
"showQuestionNumbers": "off"
}

Answers approved by surveyjs Support

created 4 years ago

Hello,
Your matrix rows values should be the same or you have to modify the value of the "Q11b", by changing key values from letters to digitals as you have in "Q29b". Please see the values of these questions and you understand what I mean.

Thank you,
Andrew
SurveyJS Team

    Show previous comments (11)

      Sorry i by mistakenly updated that contains item to capital. I know that this {item} is a reserved word. Kindly check with this updated Json. If we set the first letter for name of columns and rows to capital it does not work.

      Code
      var json = {     pages: [         {             name: 'page1',             elements: [                 {                     type'checkbox',                     name: 'q1',                     choices: ['Item1''Item2''Item3''Item4''Item5'],                 },             ],         },         {             name: 'page2',             elements: [                 {                     type'matrixdropdown',                     name: 'q2',                     rowsVisibleIf: '{q1} contains {item}',                     columns: [                         {                             name: 'c1',                             cellType: 'text',                         },                     ],                     choices: [1],                     rows: ['Item1''Item2''Item3''Item4''Item5'],                 },             ],         },         {             name: 'page3',             elements: [                 {                     type'matrixdropdown',                     name: 'q3',                     rowsVisibleIf: '{q1} contains {item}',                     columns: [                         {                             name: 'c1',                             cellType: 'text',                         },                         {                             name: 'c2',                             cellType: 'text',                         },                     ],                     choices: [1],                     rows: ['Item1''Item2''Item3''Item4''Item5'],                 },             ],         },     ],     triggers: [         {             type'copyvalue',             expression: '{q2.item1.c1} notempty',             setToName: 'q3.item1.c1',             fromName: 'q2.item1.c1',         },         {             type'copyvalue',             expression: '{q2.item2.c1} notempty',             setToName: 'q3.item2.c1',             fromName: 'q2.item2.c1',         },         {             type'copyvalue',             expression: '{q2.item3.c1} notempty',             setToName: 'q3.item3.c1',             fromName: 'q2.item3.c1',         },         {             type'copyvalue',             expression: '{q2.item4.c1} notempty',             setToName: 'q3.item4.c1',             fromName: 'q2.item4.c1',         },         {             type'copyvalue',             expression: '{q2.item5.c1} notempty',             setToName: 'q3.item5.c1',             fromName: 'q2.item5.c1',         },     ], };

        Hello,
        Indeed, there is the issue that I fixed for v1.8.21. Here is the related issue on GitHub.

        Thank you,
        Andrew
        SurveyJS Team

          OK Fine.