Solved
Can I set a hidden Question from embedded data?
I have the following task before me: I have several products in the sample. For these products I should ask the same questions. The obvious thing would be to create a loop&merge block. But it seems I can't use embedded data as fields for the Loop&Merge setup. Hence the idea would be to set a hidden multiple choice questions with the products from the embedded data and base the loop on this question. Would this work and if so how does it work. Thanks a lot for your ideas and support.
Best regards
Rudi
Best answer by PeeyushBansal
Yes you can create hidden question and punch this based on your embedded variable using java script for example:-
`Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
var ageres="${q://QID2/ChoiceTextEntryValue}";
if (ageres>="18" && ageres<="24") {this.setChoiceValue(1,true) ; }
if (ageres>="25" && ageres<="34") {this.setChoiceValue(2,true) ; }
if (ageres>="35" && ageres<="44") {this.setChoiceValue(3,true) ; }
if (ageres>="45" && ageres<="54") {this.setChoiceValue(4,true) ; }
if (ageres>="55" && ageres<="65") {this.setChoiceValue(5,true) ; }
var questionDiv = this.getQuestionContainer();
questionDiv.style.display = "none";
});`
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
