I'm new to Qualtrics, I wanted to save the data in qualtrics from custom javascript code. can anyone tell me how to do that ?
Thanks,
Abhi
Here is some API code to get you started!
`Qualtrics.SurveyEngine.setEmbeddedData('FIELD', value);`
`Qualtrics.SurveyEngine.getEmbeddedData('FIELD');`
Thanks
Abhi
!
> Just add your variable to an embedded data block in the survey flow:
> !
>
Thank you
> Yeah! Save it as an Embedded Data Field! It will show up in reporting and exports.
>
> Here is some API code to get you started!
>
> `Qualtrics.SurveyEngine.setEmbeddedData('FIELD', value);`
> `Qualtrics.SurveyEngine.getEmbeddedData('FIELD');`
thank you
Qualtrics.SurveyEngine.setEmbeddedData('FIELD', value);
Qualtrics.SurveyEngine.getEmbeddedData('FIELD');
in my custom javascript code?
> Just add your variable to an embedded data block in the survey flow:
> !
>
Just adding a screen grab of what the "Survey Flow" tab looks like:
!
Hi everyone! I'm also in a similar position. I'm using Qualtrics to record feedback data. However, I also want to record some metadata (
groupId) around this. I'm passing the metadata through JavaScript according to the documentations mentioned. Below is my HTML code snippet:
I have included this in the base HTML file. Most of the script was mentioned in the documentation. I've only added the
addOnloadmethod. However, on my server, it says
Uncaught ReferenceError: Qualtrics is not defined. Isn't the script supposed to define Qualtrics on its own? Could anyone point out what I'm missing here? Thanks!
So if I am following this thread correctly, The Set embed data block should appear before the script executes like this assuming the script executes in Block 8:
I am unclear where to put the script to record the data. This is where I put it:
Qualtrics.SurveyEngine.addOnload(function()
{
var qid = this.questionId;
document.onkeydown = function(event) {
console.log('keydown',event);
if (event.which == 37) {
event.preventDefault();
Qualtrics.SurveyEngine.registryqid].setChoiceValue(1, true);
jQuery('#NextButton').click();
} else if (event.which == 39) {
event.preventDefault();
Qualtrics.SurveyEngine.registrytqid].setChoiceValue(2, true);
jQuery('#NextButton').click();
}
}
});
Qualtrics.SurveyEngine.addOnReady(function()
{
var qobj = this;
setTimeout(function() { jQuery("#"+qobj.questionId+" .hideAfter45").hide(); },5000);
});
Qualtrics.SurveyEngine.addOnUnload(function()
{
`Qualtrics.SurveyEngine.setEmbeddedData('FIELD', value);`
`Qualtrics.SurveyEngine.getEmbeddedData('FIELD');`
});
Is this correct?
I have a series of questions that I want to capture the embedded data. Do I need a embed data block before each question or just one embed data block at the start of the series
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.