How to check if a previous text entry matches any of the choices in the current question | XM Community
Skip to main content

I am still new to this platform and this might be a simple solution.
I have a question that asks for the Canadian FSA which is the first 3 characters of the postal code (e.g. M5G)
My next question tracks if the FSA is on the list. If it's not on the list, terminate. So I created a single select hidden question that contains all the valid FSAs. What I want to do is to punch the FSA from the previous question here and then later on do a SelectedChoiceCount to check if FSA is valid.
So far I added this code but the valid FSA does not get selected.
var FSA = "${q://QID58/ChoiceTextEntryValue}";
this.setChoiceValue(FSA,true);

Can someone tell me why this code is not working?


Found the solution.
this.setChoiceValueByVariableName(FSA,true);


Leave a Reply