Impossible to load value from lookup table

I cannot use lookup tables in hidden values. I have configured according to the help page:
https://confluence.dimagi.com/display/commcarepublic/Setup+a+Question+with+Filtered+Choices#SetupaQuestionwithFilteredChoices-Loadingalookuptablevalueintoahiddenvalueinsteadofamultiplechoice/checkboxquestion

The hidden value is called “albendazole_key”
The calculation is:
instance(‘item-list:age_classes’)/age_classes_list/age_classes[class_key = ‘8’]/albendazole

The table is called “age_classes” and has the columns “class_key” and "albendazole (and others)
The table is indexed for the column “class_key”

I have tried everything:

  • with “item-list” and without
  • with single quotations (’) and double quotations (")
  • different indexes (1,5,7,8)

No success, I cannot load the form, the error on the mobile device is:
instance(age_classes)/age_classes_list/age_classes[class_key=‘8’]/albendazole
has not been loaded.

Hi Rafael,

Are you sure there are not two places in your form where you are referencing the table? You said that your calculation was

instance(‘item-list:age_classes’)/age_classes_list/age_classes[class_key = ‘8’]/albendazole

(this reference looks correct to me) but that the error message was

instance(age_classes)/age_classes_list/age_classes[class_key=‘8’]/albendazole

Which appears to be using a different ID for the instance reference (‘age_classes’ v. ‘item-list:age_classes’)

You may have a lingering reference somewhere in the form, maybe in the lookup table question or other?

Thank you for you support.
In the meantime I could solve the problem by putting class_key into quotation marks. It makes no sense to me, but it works:
instance(‘item-list:age_classes’)/age_classes_list/age_classes[‘class_key’ = ‘8’]/albendazole