Hi,
I am quite good with Javascript, but very new to Qualtrics. I have created a question in Qualtrics with much of the data populated through functions in Javascript. However, none of the dynamically populated data seems to come through into the responses data. The dynamic content appears perfectly when taking the survey, but is then stripped out of the response data, just giving the bare HTML template.
Is there something simple that I am missing?
Cheers
Page 1 / 1
Have you added the variables in the Survey flow?
Hi,
I have read about this approach in a few places, but don't think it will help me.
Basically, I am generating quite a bit of custom HTML through JavaScript, mainly because I need to do a lot of randomisation and loop iteration to generate dynamic content in the HTML question.
My guess is that if I was to add the variables in Survey Flow (which I still can't figure out how to do anyway), Qualtrics would simply pull through the raw HTML which is generated by the JavaScript iterators, and not apply CSS or anything like that.
Some guidance would be great however on how I can try the Survey Flow approach. So far, I cannot figure out how to flag up variables I have created in JavaScript.
I have read about this approach in a few places, but don't think it will help me.
Basically, I am generating quite a bit of custom HTML through JavaScript, mainly because I need to do a lot of randomisation and loop iteration to generate dynamic content in the HTML question.
My guess is that if I was to add the variables in Survey Flow (which I still can't figure out how to do anyway), Qualtrics would simply pull through the raw HTML which is generated by the JavaScript iterators, and not apply CSS or anything like that.
Some guidance would be great however on how I can try the Survey Flow approach. So far, I cannot figure out how to flag up variables I have created in JavaScript.
@jlognn - Why don't you describe what you are trying to do with dynamic content and loop variation. You might be able to do all this in Qualtrics without much JavaScript.
@jlognn,
Qualtrics doesn't save response data it doesn't know about. So, your JavaScript has to save the data to an Qualtrics question or to an embedded data field that is defined in the survey flow. To save a JavaScript variable as an embedded data field, use the setEmbeddedData function:
```
Qualtrics.SurveyEngine.setEmbeddedData("EmbeddedDataFieldName", jsVar);
```
Qualtrics doesn't save response data it doesn't know about. So, your JavaScript has to save the data to an Qualtrics question or to an embedded data field that is defined in the survey flow. To save a JavaScript variable as an embedded data field, use the setEmbeddedData function:
```
Qualtrics.SurveyEngine.setEmbeddedData("EmbeddedDataFieldName", jsVar);
```
jlognn Were you able to solve this? I am in a similar boat: https://www.qualtrics.com/community/discussion/15942/input-fields-created-using-js-not-showing-up-in-report/p1?new=1
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.