How to get a multiple choice answer into embedded data while on the same page | XM Community
Skip to main content

I have a simple multiple-choice question that has "yes" and "no" as answer options. Is it possible to get it into my embedded data on the same page as the question?

I would like my embedded data to read "yes" and "no" like the answer options.

Similar to this question (this question is the text entry version):
https://www.qualtrics.com/community/discussion/4176/how-to-get-answer-into-embedded-data-while-on-the-same-page

which was answered by
Qualtrics.SurveyEngine.addOnPageSubmit(function() {
var answer = jQuery("#"+this.questionId+" .InputText").val();
Qualtrics.SurveyEngine.setEmbeddedData("CQ1_participant_answer", answer);
});
basically I just need to know what to replace the

.InputText
with. Thank you!

var answer = this.questionContainer.querySelector(".q-checked").nextElementSibling.innerText;


Thanks this completely answers my question and I will accept your answer. Would you let me know how you figured this out so that I can do this by myself next time?


You can start here and here.


Leave a Reply