Select to view content in your preferred language

Create all repeat records with nested repeat

703
3
Jump to solution
02-15-2024 03:04 PM
DouglasKnabe
New Contributor III

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

SampleOxygenInstantaneous FlowEstimated Flow
123455.02729
123465.3301276

 

Desired output table using nested repeat:

SampleParameter

Result

12345Oxygen5.0
12345Instantaneous Flow27
12345Estimated Flow29
12346Oxygen5.3
12346Instantaneous Flow301
12346Estimated Flow276
0 Kudos
1 Solution

Accepted Solutions
abureaux
MVP Regular Contributor

You are, very unfortunately, correct. You must navigate repeats for calculates to work. I am really trying to find a way around this myself...

View solution in original post

0 Kudos
3 Replies
DougBrowning
MVP Esteemed Contributor

repeat_count will make all the repeats at the start.  But that can also make your calcs go wacky and my forms never worked out using it.  May have to play with relevant so that it does not run the repeat calcs too early.  But in your case it is prob worth a shot.

I have done something similar I think, but I do it in Python when we transfer the field data from AGOL to SDE for long term storage and analysis.  Not sure your workflow but it may work if you bring it out of AGOL at some point.  I could even see maybe a Data Expression in Ops Dashboard.  

Hope that works

0 Kudos
DouglasKnabe
New Contributor III

@DougBrowning 

I've got the repeat_count set, and have tried required/not required and experimented with setting it to relevant only once everything is complete, along with calculationMode=always. It does set it up for the specified number of repeats, but the only way I can get it to output all 4 records (the current repeat count setting) is to cycle through each record). Trying to avoid that. Also trying to minimize any post-processing beyond a straight download/transfer of the data. 

 

Found this post just now: https://community.esri.com/t5/arcgis-survey123-questions/calculationmode-inside-nested-repeat/td-p/1... it sounds like what I'm hoping for it to do may not be possible regarding it creating and calculating the records without navigating.

0 Kudos
abureaux
MVP Regular Contributor

You are, very unfortunately, correct. You must navigate repeats for calculates to work. I am really trying to find a way around this myself...

0 Kudos