Lookup Tables syntax

Hello I have been reading some articles about the topic.

I need an example of use of this syntax above:

referencePrices.Keys.Contains(self)
Verify that the lookup table referencePrices contains a key corresponding to the value of the current [numeric or categorical singleselect] question.

I think that it`s what I need but I have an error when I compile in my design.
I have a numeric question on my questionaire that identify a field plot (C2_num) and I need verify that the value answered is on my lookup table (artigas_1_2).

artigas_1_2.Keys.Contains(self)

I want it as a validation rule with a warning message if the entered value is not in my list.

Keys refers to rowcode or is a function?

Keys is a collective name of all the keys defined in the table. Treat it as a literate keyword.

Another user just recently confirmed this as a solution to a similar problem:


You can get an error if, for example, your numeric question is not integer.

Try to cast it to int:

artigas_1_2.Keys.Contains((int)self)

DO NOT USE LOOKUP TABLES FOR PRELOADING DATA (if this is what you are doing).

Thank you very match.
I could create the validation rule for my numeric question (C2_num) as a warning with your advice ( artigas_1_2.Keys.Contains((int)self) .

But I have another question. In my the questionnaire the following question C2_dpto (which is a categorical single select question ) has relation with C2_num and is present in my look up table too.

I have been trying to create a validation rule for C2_dpto which indicates a warning for example if the answer was C2_num “10000 “ and select other option different to “5” .
I think that syntax referencePrices.Keys.Contains(self) is not apropiate for this but I´m not sure.
What can you tell me about next syntax
referencePrices[7m].col5
Obtain value from line corresponding to key 7 of the column
named col5 of lookup table referencePrices. The letter m is in-
tentional and must follow the numeric constants speci_ed in this
context.
Could be this one usefull for me.?

image

Thank you very match.

I could create the validation rule for my numeric question (C2_num) as a warning with your advice ( artigas_1_2.Keys.Contains((int)self) .

But I have another question. In my the questionnaire the following question C2_dpto (which is a categorical single select question ) has relation with C2_num and is present in my look up table too.

image

I have been trying to create a validation rule for C2_dpto which indicates a warning for example if the answer was C2_num “10000 “ and select other option different to “5” .

I think that syntax referencePrices.Keys.Contains(self) is not apropiate for this but I´m not sure.

What can you tell me about next syntax

referencePrices[7m].col5

Obtain value from line corresponding to key 7 of the column

named col5 of lookup table referencePrices. The letter m is in-

tentional and must follow the numeric constants speci_ed in this

context.

Could be this one usefull for me.?