Hi there - new to here! I've got a Pick, Group and Rank question where users will drag and drop items (images of a CAD $1) to one of 2 groups (see screenshot below).
I added the following JS:
These variables are also in my survey flow:
The on the next page, I want the embedded piped text to sum the number of items in each of the groups so that the value of the number of items in each group from the question before shows up.
However, this isn't working for me. Any advice?
Page 1 / 1
The code is correct, it is just written at wrong place. Still using the above code the ED will be set but we can use it only on the next to next page from the page were we have written the JS.
In order to use it on the very next page use the below code:
Qualtrics.SurveyEngine.addOnPageSubmit(function(type)
{
var that = this;
if(type == "next")
{
Qualtrics.SurveyEngine.setEmbeddedData("AlexCount", jQuery("#"+that.questionId+"group0 li").length);
Qualtrics.SurveyEngine.setEmbeddedData("JeffCount", jQuery("#"+that.questionId+"group1 li").length);
}
});
Thank you SO much! It worked!! Such a relief. I really appreciate your help.
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.