Hi all -Been doing some javascript to preselect multiple choice options, and now I have a few questions that are currently in matrix table forms. While I could separate them into their own distinct questions, from a user experience perspective I’d rather keep them in a matrix table. I wonder if it would be basically the same model, a la the below code, but would love input! const choices = this.getChoices(); if ("${e://Field/BIPOC}".includes("0%")) this.setChoiceValue(choices[0], true); if ("${e://Field/Women".includes("0%")) this.setChoiceValue(choices[1], true); if ("${e://Field/LGBTQ}".includes("0%")) this.setChoiceValue(choices[2], true); if ("${e://Field/PersonwithDisablities}".includes("0%")) this.setChoiceValue(choices[3], true); if ("${e://Field/Veteran}".includes("0%")) this.setChoiceValue(choices[4], true); if ("${e://Field/BIPOC}".includes("1-25%")) this.setChoiceValue(choices[5], true); if ("${e://Field/Women".includes("1-25%")) this.setChoiceValue(choi
Hi all -I’m using javascript to preselect answer options based on embedded data in multiple choice questions. @ahmedA gave me great tips on using const choices when I was having some issues there. Now I am struggling with how to set it up for matrix questions. See the question and code below - nothing is pre-selecting. Any advice very appreciated! const choices = this.getChoices(); if ("${e://Field/ESGFirm}".includes("Yes")) this.setChoiceValue(0,0,true); if ("${e://Field/ESGFirm}".includes("No")) this.setChoiceValue(0,1,true); if ("${e://Field/ESGPortfolio}".includes("Yes")) this.setChoiceValue(1,0,true); if ("${e://Field/ESGPortfolio}".includes("No")) this.setChoiceValue(1,1,true);
Hi all -Very thankful for this community as I am working to set up a survey that has a lot of answers pre-filled from previous responses. I’ve already found and successfully employed a javascript code to pre-select multiple choice question options based on embedded data; however, I am now not able to duplicate it for some reason.The code I used was:Qualtrics.SurveyEngine.addOnReady(function(){ if ("${e://Field/InvestorRole}".includes("Majority")) this.setChoiceValue(1, true); if ("${e://Field/InvestorRole}".includes("Minority")) this.setChoiceValue(2, true); }); I think tried to use it for the next question, reolacing the items highlighted and adding rows as needed (and then, of course, going up in numbers on set choice value - 3, 4, etc.). Now… nothing. Any ideas? I’m very confused. I double checked embedded data was entered properly, no case differences, changes published, etc.
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.