Ah, yes good idea! I can't have the hidden question within the second loop and merge block, so I'm creating a separate "setup" block before each of the subsequent loops and merge blocks. Within the setup block, I'm putting the question that I populate with Javascript. I have that question set to be hidden and automatically click the next button using Javascript. For some reason, two small boxes with up/down arrows show up in near where the "next" button would be. I can't figure out what they are or where they're coming from. Any tricks to get that transition to be more seamless? This is my code:Qualtrics.SurveyEngine.addOnload(function(){ jQuery("#"+this.questionId).hide(); this.hideNextButton(); var selections = "${q://1_QID325/SelectedChoicesRecode}"; var selectionArray = selections.split(","); var i; for (i = 0; i < selectionArray.length; i++){ console.log(i); this.setChoiceValueByRecodeValue(parseInt(selectionArray[i]), true); } this.clickNextButton();});
TomG I implemented this solution today by creating 180 hidden questions and attaching the above Javascript code to them (each referring to a different loop in the previous Loop and Merge question). When I test this out, the page with all the hidden questions takes about 20 seconds to load. Do you happen to know of any ways to optimize the load time for a page like this, or any workarounds to avoid this?
Figured out the issue. It was a combination of 1) the recode values for the question that my JS was attached to getting totally out of whack (must have happened when I was troubleshooting) and 2) selections[i] in the loop should be selectionArray[i] (see corrected code snippet). Qualtrics.SurveyEngine.addOnload(function(){ var selections = "${q://92_QID325/SelectedChoicesRecode}"; var selectionArray = selections.split(","); var i; for (i = 0; i < selectionArray.length; i++){ this.setChoiceValueByRecodeValue(selectionArray[i], true); }});A couple tips for others... for posterity: Qualtrics documentation says that setChoiceValueByRecodeValue takes a string as input for the recodeValue parameter, but it actually takes integersCheck your recode values regularly when you're troubleshooting
Ah I see! Thanks TomG. I've been trying out various versions of something like this:Qualtrics.SurveyEngine.addOnload(function(){ var selections = "${q://92_QID325/SelectedChoicesRecode}"; var selectionArray = selections.split(","); var i; for (i = 0; i < selectionArray.length; i++){ this.setChoiceValueByRecodeValue(selections[i], true); }});It doesn't seem to be working. Any pointers?
That seems like it could be more efficient than my backup plan of breaking the first loop and merge out into 180 blocks. Any pointers on where to learn more about populating the choices of a MC question with Javacsript? Thank you for all your help so far!
In case others happen upon this, I received an answer in a separate thread: https://www.qualtrics.com/community/discussion/10286/populating-loop-merge-fields-with-the-selected-choices-from-another-loop-merge-question/p1
I've never used custom code with Qualtrics -- do you happen to have a feel for whether this is something that could be more easily solved with Javascript if I took the time to look into it?
I should add: I plan to make a subsequent L&M block for every loop of Q1 in B1 (180 in total), each referencing the selected options to Q1 from one of the loops in B1. If the solution will work for a copied version of the subsequent blocks without requiring much manual configuring for each of the 180 follow-up blocks, that would be ideal.
https://www.qualtrics.com/community/discussion/comment/13945#Comment_13945Hi TomG , you mentioned that you can pipe Loop & Merge values into a second Loop & Merge setup as fields. How does that work?Specifically hoping to solve this problem: I have an initial Loop & Merge block with a select any question, Q1. I would like to populate a second Loop & Merge block with the selected Q1 items. Qualtrics' built-in "Loop based off of a question" doesn't let me specify which loop to populate the fields from. Any ideas?
Already have an account? Login
Enter your 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.