Issue T20971
Visible to All Users

Nested matrices' expression `row` selector

created 3 months ago

The row selector inside expressions (to compute expressions using cells or details inside each row) is left unusable after a nested matrix is processed.

Example:

JSON
{ "pages": [ { "name": "page1", "elements": [ { "type": "matrixdynamic", "name": "outer_matrix", "columns": [ { "name": "Column 1" }, { "name": "Column 2" } ], "detailElements": [ { "type": "matrixdynamic", "name": "inner_matrix", "columns": [ { "name": "Column 1" }, { "name": "Column 2" } ], "cellType": "text" }, { "type": "boolean", "name": "has_question2" }, { "type": "text", "name": "question2", "visibleIf": "{row.has_question2}" } ], "detailPanelMode": "underRow", "cellType": "text" } ] } ] }

With inner_matrix before question2 (which has a condition based on row) it will not work as intended, because row is left as null after inner_matrix is processed for its conditions (even when none exists).

Move inner_matrix after question2 and everything works fine.

I guess that the solution is to make the row value become a stack (with a reference without index be handled as row[0]). When any matrix' conditions are processed, if a row value already exists, then it should push the new row before processing (instead of overwriting it as it is now), and pop it after (instead of writing null as of now).

Comments (2)

    Hello Rodrigo,
    Thank you for reporting this issue. We'll research it and update you as soon as we get any news to share.
    https://github.com/surveyjs/survey-library/issues/9137

    Please stay tuned.

      Hello Rodrigo,
      This PR fixes the issue. The fix will be available in the version we will release next week.

      Thank you,
      Andrew
      SurveyJS Team