Use question choice to set embedded data | XM Community
Question

Use question choice to set embedded data


Userlevel 1
Hello everyone,
I need a code to set EmbeddedData on basis of the selected choice. This is where I want to go:

Qualtrics.SurveyEngine.addOnPageSubmit(function() {
var choice = parseInt(this.getSelectedChoices());
var status = ["now", "still"];
if (choice = 1){
status = "still";
} else {
status = "now";
}
Qualtrics.SurveyEngine.setEmbeddedData("Status", status);

I have a very complicated survey flow and cannot use branch and bound or display to incorporate the logic.
Best

2 replies

Userlevel 1
var choice = parseInt(this.getSelectedChoices());
var status = ["now", "still"];
if (choice = 1){
status = "still";
} else {
status = "now";
}
Qualtrics.SurveyEngine.setEmbeddedData("Status", status);

I still have not found a solution to this. Can anyone help me?
Thank you so much
Userlevel 4
Badge +17
I don't know how to do this outside of putting in embedded data in the survey flow just after the block in question.

Leave a Reply