Matrix Carousel multi-select- limit choices | XM Community
Skip to main content
Solved

Matrix Carousel multi-select- limit choices

  • 22 July 2024
  • 3 replies
  • 38 views

I have a question set up to be a matrix table displayed as a carousel. The scale points are multiselect, but I want respondents to only be able to select up to 3 scale points. Can’t find a current functionality for this when a matrix question is in the carousel format, and with 14 statements would prefer overly complex custom validation.

hi @lucindarp28 , assuming you have 4 statements - a,b,c,d; along with 5 scale points with recode values - 1,2,3,4,5. For your every statement you can add a respective custom validation which says ‘a (recode) is equal to ^(?:o1-5])(?:,]1-5]){0,2}$’. Repeat this for all the statements.

here, ^(?:o1-5])(?:,-1-5]){0,2}$ is a regex which allows only 3 recode values between 1 to 5 and if its not followed then an error message will pop up (this can be of your choice, saved as the library message as well).

END!

 


I’m having some issues implementing this, and am now getting an error message that won’t proceed even when answered correctly @omkarkewat

I am using the same logic you laid out with 9 statements - A-I; and 14 scale points - with the values recoded 1-14. Though I forgot to note, the 9 statements are carryforwards based on selected choices in a previous question. So though there’s a chance for a respondent to see all 9 statements they could also only see 3/9. Due to this I used “OR” rather than “AND”. For the regex I am using ^(?:i1-14])(?:,>1-14]){0,2}$ to fit my specifications.

To ensure I am properly explaining myself, I am not trying to limit a maximum of three statements per scale point, but a maximum of three scale points per statement. If you notice what I could be doing wrong here please let me know!

 


@lucindarp28 this is happening because you have used ‘OR’ operator. So it will check if any one of the statement is having less than or equal to 3 scale points and if yes, then it will move forward irrespective of other statement is having more than 3 scale points.

you’ll have to either go by the standard lengthy method of multiple custom validations for all the statements with various permutations and combinations or maybe try using a custom Javascript code (I’m not good at it).


Leave a Reply