How can I conditionally display labels depending on the answers selected in a series of multiple choice lookup tables (similar to the filter with Xpath to do this with lookup tables)?
Can I use the answer from a lookup table as a display condition for a label in my app, or would the best option to reference my lookup table in my form be to use < instance id="random_questions" src="jr://fixture/item-list:random_question"> in a hidden value and then use that hidden value in the display condition of my label?
Best Answer
You can indeed. It's a little difficult to explain generically, so I'll use the example from this wiki page. Let's say you have a question (called "Select District") where the choices come from a lookup table:
Your question will probably have "Value Field" set to "id" and "Label Field" set to "name". When the user then selects, for instance "Jamnagar", the value of that question will be "ja". You can then use that to get more information from the selected row wherever else you may need it. Here's how you reference the name of that row:
If you have a question that you only want to display for districts where "state_id" is "gujurat", you can add a display condition like: