Dynamic Data Attachments with indexed-repeat

Hi, I have two forms. In one of them there is variable called P_name, that stores names of a roster of people. I want to display those names in another form so I linked them both following the instructions from the Dynamic Data Attachments instructive. I manage to do it without problems except for retrieving all the names stored in P_name, I just get the last one. The code that I am using is:

indexed-repeat(instance(‘survey’)/root/data/group_roster/P_name, instance(‘survey’)/root/data/group_roster, position(…))

I don’t know if it is the right approach for retrieving all the names in P_name, but is not working. I appreciate the help. Thanks.

Welcome to the community @cocoyote! Sorry to inform you that the dynamic data attachment feature currently does not support linking the records dynamically to or from a repeat group.

Thank you Kal_Lam for your quick response. As an alternative, I use the pulldata function to pull from a csv file names from a roster of people to ask them questions to each one. It behaves as expected on the web Enketo form (meaning that each name is referenced to the question correctly). But in the kobo collect app the names of the people do not appear. I am attaching photos to illustrate my point. Do you know what might be happening? Thanks

@cocoyote, would you mind sharing your XLSForm and the CSV file so that the community should able be able to have a closer look at it?

Hi @Kal_Lam, I am sharing the XLSForm and 5 CSV files. The reason for 5 CSV files is that I wanted to replicate an example of 5 different teacher (Profes) with their students. I also made an example with just 1 csv thinking my if statements where at fault but I had the same results (by the way all the names are fictitious so there are not issues with private data sharing). Thanks!
asistencia.xlsx (10.7 KB)
tabla.csv (484 Bytes)
tabla5.csv (570 Bytes)
tabla4.csv (542 Bytes)
tabla3.csv (498 Bytes)
tabla2.csv (508 Bytes)

@cocoyote, I don’t see them being dynamically linked?

Hi @Kal_Lam the pulldata function is on f8 cell wrapped in an if statement “if(${C_profe} =‘profe1’, pulldata(‘tabla’,‘name’,‘id’,${name_pos}),if(${C_profe} =‘profe2’,pulldata(‘tabla2’,‘name’,‘id’,${name_pos}),if(${C_profe} =‘profe3’,pulldata(‘tabla3’,‘name’,‘id’,${name_pos}),if(${C_profe} =‘profe4’,pulldata(‘tabla4’,‘name’,‘id’,${name_pos}),if(${C_profe} =‘profe5’,pulldata(‘tabla5’,‘name’,‘id’,${name_pos}),‘lola’)))))” That variable is called C_name

The reference to the name I want to pull is on C9 “Asistió a clases ${C_name}”

Answering your question I realized that was easier to use only one csv file using the variable C_profe as the match variable, without the need of an if statement. I got the same results, the names appear on the web form but not in the collect app. Thanks

1 Like

Dear Kal_Lam

it’s still a big request to have a feature which can handle the dynamic attachment within repeat group. It’s very important to have it. In health case, the enumerators collect data from the household’s members (form1) in repeat group and the supervisor aggregate the information coming from different enumerators (form2) in repeat group. Each repeat in the form2 correspond to information coming from each enumerator. I search for many days without solution. Any clue? thanks