Now, I’m calling this “tricky” because i haven’t figured it out yet and was hoping some guru would be able to help me out.
First: The scenario ->
A: I have a registration form for a case type “Family”
B: inside the registration form for Family, i have a repeat group with 3 questions to record family members for example. let’s assume i’m asking for name, age, and gender. These are also used to create child cases of the type “Individual” or “family_member”
C: after the repeat is finished, a few questions later, i ask a question “Which family member is the head of household” for example
D: I would like to see the list of family members in a single-select multiple choice.
I am well aware that we can use the child cases as a multiple-choice lookup table. but, for that to work, i’d need this form to be closed before the parent and child cases are created and then can appear in a lookup
So, the easy fix is to close the registration form and do a second followup form. But, i have a feeling the some of the users are going to turn around and ask if we could have it in the same form without having to navigate somewhere else.
Any ideas? I thought of reconstructing whatever format the multiple-choice lookup likes, but i found out that it likes XML and it seems a little overkill to construct an XML string to feed it when i don’t even know if it would work.
Simon, your solution works great! you are my hero! Somehow, i didn’t realize that i could just query the form!
If i could mention this, i was looking at valid xPath expressions i could use in calculations. Would you be able to point me towards them? At some point i was trying to concatenate all the entries in the repeat group and show them as a label (just to see what it would look like) and i got an error saying that it doesn’t work, i tried concat and string-join. Any idea where i can find out what works?
Jumping on this thread. I am using the information in this documentation to try to pull the child cases created but the names do not show up
My farmer names do not show up. My scenario is: Create a new group and register farmers under it using a repeat function. I then set up another menu (to register clusters) using the same case type as the one used for creating the groups.
The cluster form is set up as a follow up form so when using it you first have to select the group then select the farmers. One group can have multiple clusters, so i want to be able to see farmers in the selected group.
This is the function i am using for my lookup table data:
If the full expression itself is returning the expected set of cases, it might have something strange to do with how the lookup table question is situated in the form, but my guess is that it’s more on the data side.
I think I might have needed to provide more context for my suggestion. The web apps data preview feature is something that doesn’t require you to change your forms at all. You can use it while you are looking at a form in the Web Apps or Live Preview system to run queries against the “live” form and casedb structure to see what they are evaluating to in practice.
You can access the data preview by clicking the Blue Bubble on the Live Preview frame and you can do the xpath eval test by choosing it from the “three line” menu from within Data Preview.
A: Yes, I agree with Ethan that does look like a fancy quote.
B: You don’t always need to use all 3 conditions that you’ve set up to get the child cases. But i think that if you get rid of the fancy quotes you’ll get some results back.
C: Make sure you’re putting the right values in the value field. if you use a field that has blanks or spaces or special characters this will throw an error when you try to load those values in to the multi-select. so use something like caseid or something that you are 100% is database compatible