I am currently trying to add all selected options from three different multi-select questions into one drop-down question so the user can select which of their selected programs is their primary program of interest. Based on this question (https://www.qualtrics.com/community/discussion/9584/multiple-choice-track-individual-selected-choices-in-piped-text) I learned that this isn't possible to do without JavaScript, so I built out my code, but for some reason, it is not populating to the embedded data fields I set up. I know it's getting the correct data and my for loops are looping through the arrays correctly. Please help!
Qualtrics.SurveyEngine.addOnload(function()
{
var certAll = "${q://QID17/ChoiceGroup/SelectedChoices}";
var mastersAll = "${q://QID15/ChoiceGroup/SelectedChoices}";
var phdAll = "${q://QID19/ChoiceGroup/SelectedChoices}";
var certArr = certAll.split(', ');
var mastersArr = mastersAll.split(', ');
var phdArr = phdAll.split(', ');
for (var i = 0; i < certArr.length; i++) {
switch (i) {
case 0:
Qualtrics.SurveyEngine.setEmbeddedData("${e://Field/Program0}", certArr[i]);
break;
case 1:
Qualtrics.SurveyEngine.setEmbeddedData("${e://Field/Program1}", certArr[i]);
break;
case 2:
Qualtrics.SurveyEngine.setEmbeddedData("${e://Field/Program2}", certArr[i]);
break;
case 3:
Qualtrics.SurveyEngine.setEmbeddedData("${e://Field/Program3}", certArr[i]);
break;
}
}
//two more for loops after this that populate the rest of the Programx fields...
Accessing Multi-Select Answers and Populating to Embedded Data
Best answer by ahmedA
Change
Qualtrics.SurveyEngine.setEmbeddedData("${e://Field/Program3}", certArr[i]); to Qualtrics.SurveyEngine.setEmbeddedData("Program3", certArr[i]);Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
