I have a loop and merge block, and I would like certain questions to display based on the value of an embedded data field that CHANGES with every loop. Here is my code, which does not work:
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
var trial = "${lm://CurrentLoopNumber}" - 1;
var embData = "rating" + trial;
if (Qualtrics.SurveyEngine.getEmbeddedData(embData) == -1) var display = 5;
Qualtrics.SurveyEngine.setEmbeddedData( "display", display)
And then in my display logic for the question, I say to show question if embedded data field called "display" is equal to 5.
Basically, I've named my embedded data fields in a systematic way so that they can be differentially accessed on different loops, so I'm not sure why this isn't working. I also have very little javascript experience, so any help would be greatly appreciated!
Question
How can I utilize variable embedded data field names in display logic?
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
