you can create multiple embedded variable and in javascript you can write if condition to check with iteration is currently running based on that you can set the embedded variables
>
@Imran_Ansari said:
> you can create multiple embedded variable and in javascript you can write if condition to check with iteration is currently running based on that you can set the embedded variables
But if I do that then I need more than 100 variables.
And how do I know which iteration of the Loop and Merge am I in?
I was dealing with a similar problem. I have created one embedded field and at each iteration of Loop and merge I took it and concatenated my actual value to it and a separator.
If you want to use it again later in the questionnaire, you can split it using the `split` method easily. (Values are in the randomized order, not the original one if the loop is randomized)
My original resource is
here.
Qualtrics.SurveyEngine.addOnPageSubmit(function()
{
var questionText = "${lm://Field/1}" + ";"; //Takes field1 from Loop and merge (replace it wit your value of choice1) and adds a semicolumn to it
var order = "${e://Field/efield}"+ questionText; //gets the old value of e. field and concatenates a new value to it
Qualtrics.SurveyEngine.setEmbeddedData("efield", order); //updates the e. field
});