Dynamic linked form issue - Child form fails to fetch data from different group than identifier variable


I have two forms which are dynamically linked. Imagine that the parent form is meant to establish a list of target populations and the partner agency operating in each country, with one form filled per country. The child form is meant to be a repeating submission to report the number of monthly attendees from each of the target populations submitted in the parent form. I would like the child form to reference submissions from the parent form to display the names of the partner agency, as well as the names of the target populations, based on the country selected.

In both forms, the identifier variable is ‘X_country’ which is located in ‘X_group_1.’ The name of the partner agency (‘X_partner_name’) is also located in ‘X_group_1’ in both forms. The target population variables (‘X_target_pop_1’, ‘X_target_pop_2’, etc.) are located in ‘X_group_2’ in both forms. Once I have the forms linked, only the partner agency variable is auto-filled in the child form. The target population variables remain blank. How can I resolve this?

Syntax for pulling partner agency names (working fine): instance(‘parentform’)/root/data[P_group_1/P_country = current()/…/C_country]/P_group_1/P_partner_name

Syntax for pulling target population names (not working):
instance(‘parentform’)/root/data[P_group_1/P_country = current()/…/C_country]/P_group_2/P_target_pop_1

Welcome to the community, @caratupps! Are you trying to link your child form with a value from a parent form’s repeat group?

Hi @Kal_Lam. No, there are no repeating groups in either form.

@caratupps, were you able to link your forms successfully with the sample workaround shared in our support article?

Hello @Kal_Lam. I did use the support article to build my parent and child forms. As outlined in my original post, this worked when both variables were in the same group, but did not work when they were in different groups.

I will use the exact example from the support article:

Return P_Name (P_Demographic group) from the parent project where C_SN in the child project is equal to P_SN in the parent project:

instance(‘survey’)/root/data[P_Demographic/P_SN = current()/…/C_SN]/P_Demographic/P_Name

When attempting to set this up in a form where both ‘P_Name’ and ‘P_SN’ are in ‘P_Demographic’ group, this works fine. When attempting to set it up in a form where ‘P_SN’ is in ‘P_Demographic’ group, but ‘P_Name’ is in a different group (e.g. ‘P_GroupX’ in the example below), it does not work at all.

instance(‘survey’)/root/data[P_Demographic/P_SN = current()/…/C_SN]/P_GroupX/P_Name

My current workaround is to ungroup all questions so that the dynamic data function works, but this is not ideal for longer forms.


@caratupps, this post discussed previously should help you solve your issue:

@Kal_Lam Sorry, but this still does not replicate the issue that I and Adom are experiencing in the post you’ve linked.

The forms you attached did not put the reference variable (in this case, P_SN) in a different group than the other variables from which we are trying to pull info (P_Name, P_Age, P_Sex, etc.).

When the reference variable is in the same group as the others, the commands work fine. What I would like to see is the syntax to pull information from variables which exist in a different group from the variable we are using to link the forms.

I have updated your forms and put the variables for Family Size, Languages, and Location in a new group. If you upload these forms with the current syntax you’ll see that the info for the Name, Age, and Sex variables will be updated in the child form (because they exist in the same group as the SN variable), but the info for the Family Size, Languages, and Location variables will not (because they exist in a different group from the SN variable).

Round 1 (Within Groups) - UPDATED.xlsx (14.7 KB)

Round 2 (Within Groups) - UPDATED.xlsx (11.6 KB)