I have a problem with using loop and merge pipe text in java script. I try to create embedded data, which will be sum of two fields, and display it on the next page. I want also to create the code which will work on with loop and merge functionality. For summing the values, i used QIDs instead of piped text, as pipe text have some problems with displaying on the next page (it seems that it ned to be reloaded, by getting back to the question from which i am taking piped text).
here is some code i wrote:
_Qualtrics.SurveyEngine.addOnPageSubmit(function()
{
var nr = "${lm://Field/1}";
var name1 = "QR"+nr+"~QID2~1~1~TEXT";
var name2 = "QR"+nr+"~QID2~1~2~TEXT";
var sum = (name1^1 + name2^1)
{
Qualtrics.SurveyEngine.setEmbeddedData("sum", sum);
}
});_
However what i have tried, it seems that loop and merge from loop and merge: ${lm://Field/1}, does not work in java script.
I would great appreciate if anyone had similar problem or know how to use loop and merge variable in the java script.
Thanks!
Piotr
Best answer by TomG
View original