Change Row and Column Visibility in a Multi-Select Matrix
Matrix questions allow you to dynamically manage the visibility of matrix rows and columns. In this demo, matrix rows list car brands, and matrix columns display different qualities that you can rate. Use the checkboxes below to select the car brands and qualities that should appear in the matrix.
To implement conditional visibility for matrix rows or columns, follow these steps:
Prepopulate the matrix's
columnsandrowsarrays with choice options from the main questions.
In this demo, therowsarray contains a copy of choice options from thecarsquestion, while thecolumnsarray is populated with all choice options from thequalitiesquestion.Specify the
columnsVisibleIfandrowsVisibleIfexpressions.
These expressions are used as a filter for columns and rows. Use the{item}placeholder to reference a row or column being evaluated within the expression. As an alternative, you can specify avisibleIfexpression for individual columns or rows.
Refer to the survey JSON schema for a code example.