How to embed a table in the form and the syntax for indexed repeat function?

Hello all,
I am trying to embed a table in the form design. I am unsure if that is possible. Therefore, I used a repeat function in which I used the column heads as questions. The table is dependent on some calculations and when the same group is repeating itself, ODK is confusing between the values calculated in the first loop and is using the same values in the second loop. To correct this problem I understand that I need to use the indexed_repeat() function. Could anyone give me the syntax for that?

Also, another question is: If I am to embed a table in the form, how do I do it?

Hi @Arpan_Golechha

We doesn't support table view in ODK.

Here you can find more info about indexed-repeat()

Here is a sample form with indexed-repeat() function
choice_name_and_indexed-repeat.xls (7.5 KB)

Thanks Grzegorz! This looks simple enough to use. Is there a way that the source code can accommodate the use of tables in forms?

at this moment as I said it's not possible if you are a developer you can fork our repo and add needed changes.
Anyway, could you say more about your needs? I'm curious because someone asks about a similar feature once in a while.
For example here is another topic where I showed my implementation of tableView I prepared working for TaroWorks Building a table or matrix for a set of questions on XLSForm - #2 by Grzesiek2010

Maybe one day we'll implement a similar feature for Collect but we need info, that's why I asked about more details.

1 Like

Hi Grzegorz,
So, basically this is a huge survey which brings together several household details like the household profile, member details, occupation, energy use, roles of various members, contribution etc. So, when we collect information, it is easier to have a table so that all of the values can be entered into it and we don't have to repeat the same question for each member of the family. Also, when data is collected and stored on the server through a repeat function, the column sends us to an external link with the data housed there. This is an inconvenience as well because it increases drastically the time for data cleaning. For instance:


If you look at the above image, the 'View' option is embedded in the data and takes us to:

Now, the above data has to be incorporated in the same excel file that the rest of the data is in. This becomes slightly inconvenient when one is engaged in very large scale data collection. Is there a way to by-pass all this other than the use of tables? If so, can the data withing the repeat group be merged without having to copy paste it all the time?

You can export repeats directly with Briefcase.

To merge repeats, I usually open all of the CSVs in a single Excel document with each being a sheet. Then in the repeat sheet, I use the index and match functions to bring in the data from the base form.