Hello,
We are running a survey that uses custom Javascript to set future answers based on past responses.
For most subjects (~95%), the embedded data works fine and saves as expected. However, for a small set of subjects (~5%), embedded data fields are blank in the external data set, but these subjects report no seeing the values normally when contacted after the survey.
- I declare embedded variables in a 'Set Embedded Data' block at the start of the survey.
- In custom code on a later question, I set the value of this variable using Qualtric's js API.
Qualtrics.SurveyEngine.addOnReady(function()
{
var embeddedVar = 'hello world';
Qualtrics.SurveyEngine.setEmbeddedData('embeddedVar', embeddedVar);
});
- In a future question on another page, I pipe in this variable to question text as ${e://Field/embeddedVar}.
- Everyone sees the message 'hello world' in the question text. However, for a very small portion of respondents, the embeddedVar variable is NA.
Does anyone know why the {{Qualtrics.SurveyEngine.setEmbeddedData()}} function would fail to record data for a small set of respondents but function smoothly for the majority of respondents?
Note, the code in our actual survey is much more complicated, and it would not be feasible to provide it all here. I have not been able to reproduce the error on my own computer. A few other things about the problem and possible thoughts:
- We record a large amount of embedded data because we have to set individual values for each question.
- Whenever this occurs, the individual is running Chrome on Windows (version 88 or 90). There are people with the same OS/browser for which the code works correctly.
- We have two embedded data blocks. The second embedded data block, which is declared after the code in question, is visible for these respondents.
I would appreciate any thoughts or advice you might have.