Hi there!
I have to categorize answers to groups and am using embedded data for that. It works for all my single response questions but with the multi sesponse question it does not work. It should be simple but somehow I was not able to find a soluteion so far
var zwinf_kat= "";
if("${q://QID115/SelectedChoicesRecode}" == "1") {zwinf_kat="1"};
if("${q://QID115/SelectedChoicesRecode}" == "2") {zwinf_kat="1"};
if("${q://QID115/SelectedChoicesRecode}" == "3") {zwinf_kat="2"};
Qualtrics.SurveyEngine.setEmbeddedData( "zwinf_kat", zwinf_kat);
Thank you for your help :-)
Cheers
Solved
Set embedded data based on a multiple choice question
Best answer by TomG
${q://QID115/ChoiceGroup/SelectedChoices} is a comma separated list of choices. So,
var zwinf_grob = "";
jQuery.each("${q://QID115/SelectedChoicesRecode}".split(", "), function(i, val) {
if(val=="3") zwinf_grob = "2";
else zwinf_grob = "1";
});
Qualtrics.SurveyEngine.setEmbeddedData( "zwinf_grob", zwinf_grob);
Leave a Reply
Rich Text Editor, editor1
Editor toolbars
Press ALT 0 for help
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.