Indexed-repeat error

Hi everyone, I hope you can help me with this problem

** 1. What is the problem? Be very detailed. **
I must do a survey that is separated by modules. Then I make a concat to bring the data from begin_repeat where I have the data that I want to be repeated in the following modules. The error always gives me when I charge the last member.

I also need that the name parentesco cannot be selected 1 if it is not older than 16 years

** 2. What application or server are you using and on what device and operating system? Include version numbers. **
ODK Central v0.7 + ODK Collect v1.25.1 + android 7

** 3. What have you tried to solve the problem? **
Change the positions of calculations, some variables but all with little success.

** 4. What steps can we take to reproduce the problem? **
The error always occurs when loading the last record in the chain.

** 5. Anything else we should know or have? If you have a test form or screenshots or records, attach below. **


FUDSS.xls (35 KB)

Hi @Daniel_Alberto_Diaz

I think the error is in cell C24 in which you reference $apellido and $nombre.
Because they are variables included in a repeat group, you should specify which iteration the app should consider. I suggest you create a separate calculate variable in the previous row obtaining the relevant values and then reference these in the cell C24.

See also: You-may-need to use the indexed-repeat() function to specify which value you want error!

I hope this helps!
Best,
Andrea

1 Like

hi @Andrea_Martin Thank you for your time and knowledge. Indeed that was the mistake, I did not see carefully. Thank you!!!

hi @Andrea_Martin
I need to use the result of edad, parentesco. to validate other questions from the repetitions below. But I lose the loop of repetitions. Maybe I am doing wrong. As you said to declare the variables to be able to use them in other repetition groups. Could you give me an example please? If it is not much ask with my same xls. Thank you very much and sorry for the inconvenience.

As for example: 7 years or less in the edu_leer_escribir field and 10 or less years in the vacuna field that does not ask or skip it.
FUDSS2.xls (62 KB)

Anyone who can help me or at least guide me please? thanks!

hi @Daniel_Alberto_Diaz

I took a look at your form and I have the following suggestions:

  1. it is not clear to me why you need different repeat groups for the different sections. In my experience it is much simpler if you ask the whole questionnaire for each household member. This also simplifies the logic (no need for indexed-repeat) and the data cleaning (no need to multiple merging of separate tables.
  2. in some cases you recall variables that you define later in the form. While the odk converter does not automatically throw an error, the variable will likely not be displayed.

In summary, I suggest you have only two repeat groups, one at familia and one at persona level.

I hope this helps!
Best,
Andrea

hi @Andrea_Martin

because it is more practical and the form is loaded faster if the personal data of each family member is loaded first and then for each module all the people who were previously loaded. That go linear and ask everything again to each member. I'm just adding some modules but there are many. The file is very extensive, to make it linear load, so it was thought that grouping by modules is more effective, less tedious for loading in the field and in turn does not take so much time.
In addition, the survey will be modular, so that a form will be made with some modules and sometimes with other assets.

hi @Andrea_Martin

I still can't find a solution to my problem.
It turns out that I need to have the amount of family group in a home, then the number of people that make up each group. Then upload the personal data of each member and finally the modules separately, which correspond to health, education, work etc. As I managed to incorporate this perfect. The only problem I have is that at the time of validating some field I get an error in the index-repeat because I suppose that I have not declared the validity that I intend to use in the repetition since this variable is in another repetition. How can I solve that?
Example of my xls: row 46, name: emb_embarazo_sino, I need this question enabled only if I select option F in the question in row 32 and be over 10 years of age. Thanks for the help, Regards
FUDSS.xlsx (55.0 KB)