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

Hello,

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.

Thanks,
Cara

@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)

Was this ever resolved? I have the exact same issue as caratupps.

Dynamic linking works, but not if the ID I am using in the child survey to fetch parent values is not in the same group as the the questions where those values are fetched. If I put the all questions in the same group, it works.

Dear @Kal_Lam , the Dynamic data attachment article does not solve this problem.
I was able to achieve this by doing the following:

  1. I have Group_1 in Child form and Group_1 in Parent form and pulling data inside the child Group_1 using the c_ID question which is also inside Group_1 works as expected

  2. Group_2 in Child form is pulling other data based on the same c_ID that resides in Child Group_1. This does not work because the syntax of
    instance(‘survey’)/root/data[Group_1/P_ID = current()/…/c_ID]/Group_1/P_Name must be modified to navigate to the above Group_1. This syntax is not clear and I’m not familiar with these Path expressions and they are not detailed in the above article. I believe this part should change to point to the c_ID of Group_1: current()/…/c_ID

  3. My workaround was adding a calculate question called “cal_ID” at the start of Group_2 and in the calculation column I just wrote ${c_ID}

  4. Now the instance would be changed from current()/…/c_ID to current()/…/cal_ID which is the same ID copied into a calculation in the “current” group