# Question Matrix Response Type
**Last updated:** 15 Mar 2023
The Question Matrix response type allows users to create a group of questions
that display in a matrix format, whereby each cell within the matrix represents
a separate question. To use this response type, define the number of rows and
columns you want in your matrix set and give each row and column a label or
name. Each column can be a different question type. In the above screenshot, the
first two columns are select-one questions, and the third column is a number
question.
![image](/images/matrix_response/matrix_example.png)
This response type only works when using Enketo, utilizing the Grid-theme layout. Forms are set to single page layout by default -- to change it, find the "layout" button in the formbuilder toolbar, select "grid-theme", save this change, and redeploy your form to make these changes live.
Enketo supports only up to 10
columns in versions less than 2.8.0
, up to 13
including and after 2.8.0
.
## Create a Question Matrix in the Formbuilder
1. Go to your formbuilder and click on “Add question”
2. Select ‘Question Matrix’
![image](/images/matrix_response/question_matrix.png)
3. Click on the gear icon in each column to set the question type.
![image](/images/matrix_response/question_type.png)
4. Select the question type
5. Add the Column label & response label
![image](/images/matrix_response/label_response.png)
6. Select the gear icon within ‘Row’ to define the row label
![image](/images/matrix_response/row.png)
## Create a Question Matrix in XLSForm
Alternatively, you can also build a Matrix Question in a XLSForm by following
the instructions as outlined in the images below:
**survey**
| type | name | label | required | `kobo--matrix_list` |
| :--------------- | :--- | :----------------------------------- | :------- | :---------------- |
| begin_kobomatrix | M1 | Items | | assets |
| select_one yn | Q1 | Q1. Which assets do you have at home | TRUE | |
| integer | Q2 | Q2. Number of assets | TRUE | |
| end_kobomatrix | | | | |
**choices**
| list_name | name | label |
| :-------- | :--- | :---- |
| assets | car | Car |
| assets | bike | Bike |
| assets | tv | TV |
| yn | yes | Yes |
| yn | no | No |
**settings**
| style |
| :--------------------------- |
| theme-grid no-text-transform |
This method uses begin_kobomatrix
,
end_kobomatrix
and kobo--matrix_list
.
Following the steps above, you should see the question matrix shown in the
screenshot below (In [Enketo](data_through_webforms.md) only):
![image](/images/matrix_response/preview.png)
It is also possible to include `relevant` and `constraint` conditions within the
matrix as follows:
**survey**
| type | name | label | required | `kobo--matrix_list` | relevant | constraint |
| :--------------- | :--- | :----------------------------------- | :------- | :---------------- | :------------ | :--------- |
| begin_kobomatrix | M1 | Items | | assets | | |
| select_one yn | Q1 | Q1. Which assets do you have at home | TRUE | | | |
| integer | Q2 | Q2. Number of assets | TRUE | | ${Q1} = 'yes' | . > 2 |
| end_kobomatrix | | | | | | |