Spot on! 
If you look closely at your form, the first group of questions (group_el5wy41) appears to be filling in OK with the data looked up from the parent form:
For example, the Country_of_Network has a lookup function of:
instance('KnowYourNetworkAnnualSurvey')/root/data[group_el5wy41/Network_Name= current()/../networkname2026]/group_el5wy41/Country_of_Network |
This basically say lookup in instance('KnowYourNetworkAnnualSurvey') (ie the parent DDA file) the record where the field group_el5wy41/Network_Name matches the value in child form
current()/../networkname2026
[aside - you happen to be using identical group names in both your parent and child form, which may be confusing you… they are in fact entirely different entities!]
This requires a little explanation:
- the
current() references the current question (actually the current XML element), namely Country_of_Network.
- the following
/../ tells it to go up one level in the XML hierarchy, which is the enclosing (child form) group group_el5wy41.
- and the
networkname2026 references the peer question within the same group.
This is basically how you reference another question in the same group. All good so far.
However, if you look at ostensibly the equivalent question in the following Strategic Vision and Plan group, the lookup function (in red) is:
instance('KnowYourNetworkAnnualSurvey')/root/data[group_el5wy41/Network_Name= current()/../group_el5wy41/networkname2026]/group_zx9yw06/In_the_last_5_years_the_local_responses |
|
|
Similar to before:
- the
current() references the current question, now sitemapping.
- the following
/../ tells it to go up one level in the XML hierarchy, which is the enclosing group, now group_zx9yw06.
But the following group_el5wy41/networkname2026is now basically telling it to look for a subgroup called group_el5wy41 that is inside group_zx9yw06 . Which obviously doesn’t exist!
Basically, if you want to reference a value from within a group that is in another group, you actually have to go up two levels - ie up to the grandparent (which in this case if the root level of your form) - to then drill back down two level to the desired field. ie try this instead:
instance('KnowYourNetworkAnnualSurvey')/root/data[group_el5wy41/Network_Name= current()/../../group_el5wy41/networkname2026]/group_zx9yw06/In_the_last_5_years_the_local_responses
Note the /../../ which goes back 2 levels in the XML hierarchy. You will probably need to do this all over the place to get to your networkname2026 value.
Hopefully that makes a little more sense; I know these XPath things can be rather confusing (if not impenetrable
)