Hi everyone,
In my Qualtrics survey, I have a question for which I use loop & merge. Field 1 is an id that takes values 1 or 2 (for testing purposes). I set the loop and merge to randomize loop order and present only 1 of total loops.
At the top of the survey flow, I create an embedded data variable "id" (and "receiver1id"), leaving it empty.
In javascript I write the following code. The problem is that id and "receiver1id" are always empty. Could anyone point out my mistake?
Qualtrics.SurveyEngine.addOnload(function()
{
//input
var id = parseInt("${lm://Field/1}");
// output to id
Qualtrics.SurveyEngine.setEmbeddedData(id, receiver1id);
Qualtrics.SurveyEngine.setEmbeddedData(id, id);
});
Thank you!
Page 1 / 1
The setEmbedded data function should be like below:
Qualtrics.SurveyEngine.setEmbeddedData("id", id);
Qualtrics.SurveyEngine.setEmbeddedData("receiver1id", id);
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.