Array filter
Last updated
Was this helpful?
Last updated
Was this helpful?
To enable advanced array filter code for your single choice matrix question, import the library as described in the Getting started section.
Once you have completed the main steps, you will need to modify the parameters in the provided template snippet to apply the changes.
Using array filter in a matrix question will require you to disable the required parameter in order to delegate validation to this survey code.
question_code
The single choice matrix question code you want to configure.
array_filter
Here we define settings for array filter. If not needed, just remove this entire block code and skip this tutorial
array_filter
-> rows
Here we define the array filter for rows in the matrix. If not needed, just remove this entire block code.
array_filter
-> rows
-> filter
This variable specifies the question code of a filter where selected options will be taken, usually a single or multiple choice.
Only checked options in filter question will be validated.
array_filter
-> rows
-> filter_schema
This variable is the filter's schema, it tells the randomization process what answer codes appeared in filter question.
Only answer codes within filter_schema will be filtered out if they were checked. If not, they will be ignored.
array_filter
-> rows
-> type
This variable defines the type of filtering, it can be:
inclusive, to keep rows based on what was selected in filter.
exclusive, to remove rows based on what was selected in filter.
array_filter
-> columns
Here we define the array filter for columns in the matrix. If not needed, just remove this entire block code.
array_filter
-> columns
-> filter
This variable specifies the question code of a filter where selected options will be taken, usually a single or multiple choice.
Only checked options in filter question will be validated.
array_filter
-> columns
-> filter_schema
This variable is the filter's schema, it tells the randomization process what answer codes appeared in filter question.
Only answer codes within filter_schema will be filtered out if they were checked. If not, they will be ignored.
array_filter
-> columns
-> type
This variable defines the type of filtering, it can be:
inclusive, to keep columns based on what was selected in filter.
exclusive, to remove columns based on what was selected in filter.