Randomize matrix statements using javascript based on embedded data value. | XM Community
Skip to main content

Hi everyone,
I'm posting here for the first time and looking for a solution to a weird programming situation here.
I've a matrix question in my survey that needs statements randomization based on the value of embedded data. I couldn't find any native Qualtrics functionality to achieve that sort of randomization.
Context: We're basically trying to measure the impact on the scores of brand consideration if brands are listed top to bottom vs randomized.
I've Embedded data called "ABTest" where I'm piping random number (${rand://int/1:2}) and want the matrix statements to randomize if value is 2 and keep them fixed if the value is 1
Statements randomize.PNG

You could just create 2 questions one static and the other randomized. Then branch based on the random number you generate.


Thank you ahmedA for the suggestion. I proposed the same solution. However, we're making changes to an ongoing project and the data is being pulled in to the dashboards and we want to avoid the situation of adding one more question.


I was able to find the javascript that rotates the answer choices but I'm not sure how to do javascript for the statements randomization.


If you're using JS to rotate the statements, then make sure to use JS to record the randomization. Otherwise, you'll get garbage data.
Most things done using JS on client side is not sent to the server and therefore, not inline with the data stored in your responses.


Leave a Reply