Hidden value not showing in the report

I have built a survey on commcare and one of the questions in it is: select the health facility - which is a look up table. When I create a report, I don’t see the question about the health facility, so I added a hidden value in the survey and dragged the question: select the hf into the calculate condition and saved the changes. Now I could add the hidden value to the report but when I fill the survey on the tablet and submit it, I can not see the health facility name in the report. Maybe that means the health facility is not captured in the hidden value. Any suggestions are welcome

Thanks in advance

Hello there

i'm not sure why what you're saying is going on but perhaps you can gain some insight for troubleshooting if you click this button
image on the lower right from the emulator screen, which will open another window that will show you what values are currently in the form

should let you know what values are being stored and where

Mazz

Can you share with us the configuration of your multiple choice lookup table ?

Thanks !

-Michel

Below is screenshot of the excel lookup table that I uploaded into my form. What I would like is to capture the value of the health facility name in a hidden value as forms are submitted by chws and have the value as column in a report. the question Iam referring to is the selected one in the form above. Sorry because the questions are in portuguese

image

Hi,

What I was asking for was the configuration of your lookup table data in the app builder (the line under the one you selected)
In this, you should have something like this :

  • Lookup table : name of your lookup table
  • Value field : facility_name (because what you want is to capture the health facility name)
  • Label field : facility_name (I guess, since it is easier for your chws to choose this way)

You can add a filter if you want to reduce the number of choice based on the district the chw is in.

See this page for more help :
https://confluence.dimagi.com/display/commcarepublic/Setup+a+Question+with+Filtered+Choices

-Michel

Hi, Michel,

Below is the configuration of the lookup table data in the app builder. I have read the page you have suggested but I still don't figure out how I can save the facility name in a hidden value.

Thanks in advance.

Hi,

You can find instructions on how to load a reference to a lookup table on this wiki page, you'll need to write a reference which loads the value of the Multiselect question into an instance() reference to pull back out the facility name.

-Clayton

Thank you, Clayton. I will read the page.

Hi, Clayton.

I have put the expression below in the calculate condition of the hidden value but I get an error when I select district name on the form.

image

There may be a problem with the expression.

Is there more than one facility per district? You may need to add a second filter like [facility_id = #form/facility] if you are filtering on one more than one thing

Hi, Clayton.

Yes, there is more than one facility per district. Please, how would the whole expression be for the two filters?

Thanks in advance

You can put together multiple blocks of brackets, like

[condition_one = 'a'][condition_two = 'b']

to filter by more than one criteria. If you've introduced a filter into your lookup table, the first condition would likely be that filter, and the second condition would be the selection from the multiple choice question.

-Clayton

Hi, Clayton.

Thank you very much for your help. By putting together blocks of brackets as you suggested, I managed to get the facility name saved in the hidden value and it now shows in the report.