Select to view content in your preferred language

Auto-populate repeat fields from previous inspection in xlsform Survey123

79
1
yesterday
mayraiguago
New Contributor

Hello I have a problem: I'm currently using a Survey123 Connect  form to perform inspections, and I'm using a related table to record multiple inspections in a single form. The problem is that there's a length and width measurement field, but that value is maintained across all inspections. How can I make it so that when I record a new inspection, the results from the previous inspection are automatically copied? I tried to use this funtion indexed-repeat() but it didn´t work, someone could you help me, please ? thank you 

0 Kudos
1 Reply
Neal_t_k
MVP Regular Contributor

If I am reading correctly this is not currently possible as you describe.  Any calculation that references itself in a previous repeat results in a cyclic dependency error. 

If this is not a public form, @DougBrowning worked on a javascript function for this.

Reading again, does the length and width measurement ever change from inspection to inspection?  If not, why not ask it in the main part of the form, and then just bring those numbers into the repeats.  If you format the calculation with the once() function, You could maintain if there were any changes to the length and width by looking at when the those were edited, i.e. you would have a log in the repeats.

The following posts, I believe has a description of the script as well as the best discussions of what has been tried and proposed work arounds.

Prepopulate answers in a repeat with last values - Esri Community

Have a repeat in survey123 default to last record ... - Esri Community

Idea you can support:

  "Same as Last" option for repeat records in Survey... - Esri Community