Can I autocode a response from an earlier multi-select question, into a later single code q? | XM Community
Skip to main content

Hi Qualtrics Community,
I am not a Javascript guru but have looked various posts on this to gain Community's wisdom but everything I am trying is not working 😞
...so hoping someone sees this and can help.
Essentially, what I am trying to do is autocode a response from one multi-response question (QID236) into a later single response question, if only one option was selected in the multi-response question.
I thought the below Javascript would do the trick, but it does not. Note that the second question does not carry forward any options from the first as all the options are shown again to the respondent. I have argued the logic of this with my PM but that is the way it has to be for this one...
Please can you help?

Qualtrics.SurveyEngine.addOnload(function()
{

var val1 = "${q://QID236/SelectedChoicesRecode}";
var val2= "${q://QID236/SelectedChoicesCount}";

if(val2==1)
{

 this.setChoiceValue(val1, true);
// ("#NextButton").submit();

}

});

Below thread can help you to setup the autocode functionality:
https://www.qualtrics.com/community/discussion/comment/10773#Comment_10773


Leave a Reply