autocode a multiple question base on previous multiple question | XM Community
Skip to main content

Hi Community,
I have questions Q1 and Q2 as below:
Screenshot 2023-02-12 222718.png
I'd like to find a way to achieve following thing by js:
auto-code selected option from Q1 to Q2.
For example, if Q1 select a1, a2 and a4. then I'd like Q2 automatically select a1, a2 and a4.

Thanks in advance.

I am new to Qualtrics but thinking this can be accomplished by Cary Forwarding the question to next in the same survey?


https://community.qualtrics.com/XMcommunity/discussion/comment/55340#Comment_55340Hi vishi70,
Thanks, but I'm more interested to how to do it in JS,
Would like to know how to loop each option in previous question and hidden question, and within the loop, if option is selected in previous question, then auto-select it in hidden question.


Not a efficient but small code
var array1="${q://QID338/SelectedChoicesRecode}" ;     //selected choice of that question.
for(i=0;i val=parseInt(arr160ri])
this.setChoiceValueByRecodeValue(val,true) 
}
Note: Please keep the recode same.


https://community.qualtrics.com/XMcommunity/discussion/comment/55349#Comment_55349Hi SM_21, Thanks! it worked!


Leave a Reply