I'm just trying to learn how to program a Zip Code screener with JS. I've searched some post and came up with this code to test:
Qualtrics.SurveyEngine.addOnPageSubmit(function()
{
var z=" ${q://QID2/ChoiceTextEntryValue}";
var b=[99501,99502,99503,99504].include(z);
if(b){
Qualtrics.SurveyEngine.setEmbeddedData("AUTH","Eligible");
}
else{
Qualtrics.SurveyEngine.setEmbeddedData("AUTH","Not Eligible");
}
});
This is in the Q2 JS Screen and it doesn't work. I'm using piped text in Q3 to show me the values:
${q://QID2/ChoiceTextEntryValue}
${e://Field/AUTH}
I also declared AUTH as Embedded Data in the survey flow prior to Q2.
Thanks in advance.
Best answer by AnthonyR
View original