Hi, I'm having a hard time finding the right syntax to refer to embedded data fields (EDF) in javascript.
For example, I set up an EDF in survey flow called "tester", and i give it the value "hello_world".
Then I create a question item in the actual survey, and in the javascript section I try to call the field using:
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place Your Javascript Below This Line*/
var new_word = "${e://Field/tester}";
alert('the word is: '+new_word);
});
Then I run the survey in preview mode, and the alert box pops up but only shows "the word is: ". Since it doesn't just spit out "the word is ${e://..." it makes me think that qualtrics accepted the reference to the Field/ category, but couldn't pull up the value, for some reason.
I've tried a few different variations for feeding in the embedded data value, nothing seems to work, and there isn't very clear API from qualtrics for how to do this sort of thing.
Ultimately I also want to be able to call the array of all EDFs in a survey flow, so i can loop through the entire set and choose one based on its name.
for example, if i have three EDF: test-1, test-2, test-3, i'd like to be able to loop through all of them, using a similar method to the conventional document.getElementsByTagName, parse out the digits in the name of each field and select the one that ends in the number 3. then i'd want to extract the data from test-3 and display it on an actual question item in the qualtrics survey.
can anyone help me with this?
thanks,
andrew