Question
How do I write a Javascript line to add the just selected choice to an embedded data field?
Greetings all, so I have a situation where I create and initialize a embedded data field to "0" at the start of my survey flow. Then, I have a question later in the survey that, if seen, updates that value. If the respondent doesn't see that question the embedded data field should not be changed. So I want to include a bit of Javascript on that particualr question that essentially says "when the answers *this* question set the embedded data field to the selected choice." So when I put this following code in any of the three Javascript sections (addOnload/addOnReady/addOnUnload) it doesn't work. What am I missing? I think maybe I need to wrap this javascript with something else that watches for the question to be answered?
Note that this code *does* work if I put it at the end of the survey in a question everyone sees but then it screws up my initial setting and initialization of the embedded data field. Again, this should be attached to the question (QID123 in my example) so that it is only changed if the person sees and answers that question.
Qualtrics.SurveyEngine.setEmbeddedData("FOO","${q://QID123/ChoiceGroup/SelectedChoices}");
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
