How to randomly select one of the answer choices selected? | XM Community
Solved

How to randomly select one of the answer choices selected?


I want to randomly select one of the answer options from a multiple choice question (if a respondent selects > 1 option) and include it in the next question. e.g. in Q1, I ask them to select their preferred company and if Pepsi and Coke are selected, next question should randomly select one of the two and ask 'when did you last purchase a Pepsi (say) product'. I have followed the steps detailed here, but don't know which java script to use to hide the question: https://www.qualtrics.com/community/discussion/716/can-i-randomly-select-one-of-a-respondents-answers-for-use-in-a-follow-up-question. Can anyone help me with this? or if there is an alternative solution?

icon

Best answer by TomG 2 July 2020, 19:56

View original

2 replies

Userlevel 7
Badge +27

JS to hide question and click Next button:
Qualtrics.SurveyEngine.addOnReady(function() {
jQuery("#"+this.questionId).hide();
this.clickNextButton();
});

Thank you!

Leave a Reply