I am creating a survey to collect a series of parameters for multiple samples, wherein each repeat is a single sample, and there are several fields. I am attempting to use a nested repeat to incrementally create a new record for each parameter (using if statements against a repeat index calculation) to transpose the data. It is imperative, however, that the data come out of this transposed with one result per row (i.e., pivoted). I've got it worked out except that I am unable to get the inner repeat to create the records unless I manually cycle through each record.
Is there any way to have all of the records for the nested repeat created/populated, regardless of whether the user cycles through them? I cannot simply use the nested repeat to collect each parameter, as the user needs to be able to jump around on the form. I know it's not necessarily the most efficient from a data-perspective, but I'm trying to create a CSV, without further intervention, with a specific format to be digested by another program with set requirements.
The table and attached XLSForm are very trimmed down versions of what I'll be doing; the final will have about 25 parameters (fixed) and up to 9 samples (variable).
Example:
Table with a single repeat as the user enters it
| Sample | Oxygen | Instantaneous Flow | Estimated Flow |
| 12345 | 5.0 | 27 | 29 |
| 12346 | 5.3 | 301 | 276 |
Desired output table using nested repeat:
| Sample | Parameter | Result |
| 12345 | Oxygen | 5.0 |
| 12345 | Instantaneous Flow | 27 |
| 12345 | Estimated Flow | 29 |
| 12346 | Oxygen | 5.3 |
| 12346 | Instantaneous Flow | 301 |
| 12346 | Estimated Flow | 276 |