Lookup Table Data

Hello Everyone,

I am trying to pull some data in a lookup table into a hidden value in my forms so that i can see those values in my reports but its not working. I have used the syntax found in the help site but i cannot seem to get it right. Help please anyone.

Help Site syntax: instance('project')/project_list/project[id = /data/district ]/project_name

My syntax: instance('cohort_two_track_one_clients')/cohort_two_track_one_clients_list/cohort_two_track_one_clients[gender_id = data/client_name]/gender_id

Hi Jay,

Can you try adding "item-list:" before the instance name?

IE

instance('item-list:cohort_two_track_one_clients')/cohort_two_track_one_clients_list/cohort_two_track_one_clients[gender_id = data/client_name]/gender_id

If that works, can you let me know what documentation page you were following? I can make sure it gets updated.

-Clayton

Hi Clayton,

Thanks but i still get a calculation error:

Calculation Error: Error in calculation for /data/A/B/gender Logic references data/client_id which is not a valid question or value. You may have forgotten to include the full path to the question (e.g. /data/data/client_id). (Expanded reference: instance(item-list:cohort_two_track_one_clients)/cohort_two_track_one_clents

I have alternated between client_id and client_name but it still doesn't pull the gender_id data.

This is the lookup table headers:

Grateful for the help.

Hi,

In your example:

instance(‘item-list:cohort_two_track_one_clients’)/cohort_two_track_one_clients_list/cohort_two_track_one_clients[client_name = data/client_name]/gender_id

The reference to "data/client_name" should have a leading slash, IE: "/data/client_name"

To reference the element in the form that you are trying to match to.

-Clayton

Hi Clayton,

Unfortunately the syntax still doesn't work. I have even tried it with another app i am working on but i am still having errors. Below is the syntax i am using to try and pull option_one and option_two from a lookup table

instance('eni_clients_list')/eni_clients_list/eni_clients_list[client_name = #form/question1/beneficiary_name]/lrp_option_one

Error:

image

Hi,

It looks like your instance declaration is still missing the item-list: prefix. can you try adding it and see if it addresses the issue?