Nested repeats with answer recycling

04-20-2021 04:57 AM
New Contributor II

Hello there!

I'm currently building a survey with XLS-Forms with 2 nested repeats, and I want the survey to remember some parts for the next repeat.

The outer repeat is a simple counter for each messurement (1,2,3,4,...) and the inner repeat represents the data of the messurements. 

When I collect the data, the outer repeat block is set to 1 and the inner repeat is filled with data (A,B,C,D,...).

Now the outer block is repeated and is set to 2. I want the inner repeat block to remember the values of the first inner repeat block, so that the result of the second outer repeat will be 2 - A,B,C,D,... without me entering A,B,C,D,... again.

I hope that this was somewhat understandable. Thanks in advance!

Tags (2)
0 Kudos
2 Replies
MVP Honored Contributor

If you mean you want repeat 2 field1 to get the value of repeat 1 field1 then no.  This causes a loop as both are the same field name. Field1 = Field1 type logic.  If you do some searches you will find many posts on this.  I have been working with the 123 team on trying to do this for years now.

If it is a continuation and not the exact values then things like max(field) would work. 

You can now display the values using index-repeat but you can only display or add to a different field name not the same.

There may be another way to get close to what you want.  For example I created a defaults page that can add a common set of values.  See here

If you can post your form we may be able to come up with some ideas.

Hope that helps

New Contributor II

Hello Doug

Thank you for your quick answer. The links you have posted were very helpful. I reworked my form to use fixed variables for all repeats, because I think it is the easiest solution.


0 Kudos