Solved
How do I set the number of loops in a Loop and Merge based on an Embedded Data object?
I send my surveys out as anonymous links with embedded data appended at the end. I'd like to pass in a numeric value which is used to manage a Loop and Merge as if it were a question answer. Example:
I have participant data indicating how many children they have. I would like to pass the number of children value in <<anonymous link>?children=X. Then, in my survey, I loop based on the value of the children Embedded Data object.
Any thoughts on how to accomplish this?
Thanks!
FYI: I've got a bit of scripting knowledge, so could try to pick up enough .js to make this happen. But would prefer to use the GUI.
Best answer by KimothiSaurabh
@muriah - I guess you are proceeding with second approach. If loop works as expected when you fill out the question then issue is with the display logic. If you skip any question using display logic, Qualtrics will not store data for that question hence loop will not works as expected. To avoid this, remove display logic from that question and add below script in javascript of that question. This script will set response of it from embedded data (NoOfchild) and hide the question from link so respondent will not see it.
Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
jQuery('input[id*='+this.questionId+']').val("${e://Field/NoOfchild}")
jQuery('#'+this.questionId).hide();
this.clickNextButton();
});
Hope this helps.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

If you have too many questions in loop above approach may be tedious so alternate would be to create a numeric question and set loop-merge based on response of this question. You will have to set response of this numeric question from embedded variable.
As an edo you could just use ${e://Field/variable} to get the value of the variable for the answer option.