Is there a way to capture the current index of the repeating group?

I was reading the post about repeating groups here http://help.kobotoolbox.org/creating-forms/grouping-questions-and-repeating-groups
… I have used the export to excel technique which allows one to repeat a group based on the form value and it works fine. My question is

  • Is there a way to capture the current index of the repeating group?

As an example - suppose I want a group of questions to be repeated 3 times. I can insert a column in the XLS called ‘repeat_count’ and put the number 3 in the repeat group column. I have done this and it works fine. Now what I want to capture is the repeating number of the group … maybe in a calculated field … which will hold the value 1 when my group repeats the 1st time, value 2 when my group repeats the 2nd time untill the repeat_count is reached so that when I export the data I can have a column with indexes 1,2,3 for the 3 times data was collected in the repeat group.

Can this be done in some way in kobotoolbox?

1 Like

You can use the position function. Use calculate as type. and position(…) in calculation (or position (…/…) if you are in a group below the repeat).
https://community.kobotoolbox.org/t/referencing-variables-between-repeats-text-and-calculate-type-work-different/3029