Lookup table syntax to match numbers

Hello,

I was wondering what validation syntax I need to use to check whether an enumerator entered the right password (3-digit) for a specific ID number, e.g. ID = 1001, password = 123.

So the value that is entered for the variable “idwoman_p1” , should match the “pass1” column. The .txt file that I created is called “passwords_pilot”.

I tried: idwoman_p1==(passwords_pilot[@rowcode].pass1), but it did not work out. Can someone help me out?

Many thanks in advance!

Kind regards,
Brenda

passwords_pilot

Good day Brenda,
There are couple things that could be great to clarify here:

  1. Storing passwords in a lookup table seems like an insecure solution.
  2. idwoman_p1 is a text question (as I can see on your screenshot) and all values in a lookup table are decimal numbers, so that you are trying to compare string and double variables. This is not allowed operation and the questionnaire would not be compiled.
  3. I have tried to simulate your scenario here. More information about lookup tables you can find in our documentation.

Dear vfedoseev,

Thank you for your response and the simulation of the scenario. For point 2, I was wondering should I change the question type to numeric? For point 3, I tried to apply this for the questionnaire, but “userId” is not recognized. I tried “rowcode” and “@rowcode” as this is the heading of the column in the look up table with the ID numbers, but this does not work either. Could you explain what this part of the syntax refers to?

Many thanks in advance!

Kind regards,
Brenda

Good day Brenda,

For point 2, it could be done with numeric question as well I added example to the same questionnaire. But with text question and pattern ### it is much easier to prevent entering wrong format of password (3-digit number in your case).
For point 3, first of all, “rowcode” is a technical title of the first column in lookup tables (actually it could be used with roster instances, but it is not your case) and it(rowcode) is a “specific ID number” for you. I am not familiar with you survey, so in my example, some interviewer enters “specificIDnumber” and than “idwoman_p1”. After that application compares “pass1” (the row with the same code as specificIDnumber) from the “passwords_pilot” lookup table with “idwoman_p1” value and shows error message if they do not equal. Please take a look at it one more time, also you could download and inspect my lookup table as well.

There is an example for your multi-select question issue from the another topic in the same questionnaire.

Best regards,
Vladimir

Dear @vfedoseev

Many thanks for your explanation and the example questionnaire. I went through it and applied it to our questionnaire and now it works perfectly.

Again, thank you for your support and quick reply!

Have a nice day,

Kind regards,
Brenda