SmooveEnergry SmooveEnergry - 2 months ago 14
Javascript Question

Is it possible to save a variable from javascript to the qualtrics dataset?

I am currently working on a qualtrics survey that includes a javascript part. It's basically all set, except I cannot get the response variable from the javascript part to be saved in qualtrics. The variable is a counter of how many times the participant clicked on different options. Is it somehow possible to just add the variable to the dataset?

Any help would be appreciated.

Cheers

enter image description here

enter image description here

Answer

Initialize the embedded data variable in the survey flow. Then set it in the JavaScript with:

Qualtrics.SurveyEngine.setEmbeddedData(variable, value);