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

Dear ligui,

I came across your question, as I am having a similar challenge with our workflow. Have you found any solution for handling dynamic attachments within repeat groups?

Thanks so much. Best,
Peter

Dear JaoPao,

There is no way for the moment to solve dynamic data attachment in repeat group, I try but failed. The only option but no satisfaction in this method, is to record the group (no repeat group) many times as possible instead of using repeat group.
I am wondering why it is so hard for the developer to handle this.

Best,

Thanks so much for your prompt follow-up. I’m sorry to hear there wasn’t a solution. The workaround you’re using seems like one possible option, but I think I might just try to do some custom XLSForm and using the pull data function.

It seems like a very basic function for longitudinal studies that work with household clusters. I’m hopeful that the KoboToolBox team will implement a solution someday.

Cheers,
Peter

Hello! @JaoPao, @ligui, @Kal_Lam,
I have read this thread with great interest (thank you all!), having spent a few hours trying Dynamic Data with repeat groups. As these nodes showed up in the “Connect Projects” page for the parent I just assumed they would link!

Having read this thread I tried a work around:

  1. Read the multiple nodes in a repeat group into a text node within one repeat in the Parent Form
  2. Then use join() command outside a repeat group into a different node
  3. Pass this new node (which is now outside a repeat group) to the Child form as usual

Unfortunately, this is not working. The Child form is reading all other shared nodes as usual but is not reading these ones. Any help is greatly appreciated. Thanks!

Here is the xform snippet for the Parent form:


Here is the xform snippet for the Child form:

I have tested the logic in a separate form and found it working fine, so it is only a linking issue. I am on KoboConnect.
The specific issue is that ${NumDEP} is successfully passing between parent and child. But ${DEPDefinitionList} is not. Thanks!

This issue got resolved, I had cast the node as an int() which was a mistake.

Hi Dear @Kal_Lam, I have noticed that the community (including myself) really need this feature. We will really appreciate it if this is included in the upcoming releases.