I am trying to use the results of a multiple choice question to automatically generate and populate repeat records. I decided this was possible after reading this post and response by @JamesTedrick but I'm struggling to implement the suggested solution. I used the count-selected(${question}) in the repeat_count field to set up the number of repeats. I am trying to figure out how to populate the treatmentName field based on the selected values by their index. As suggested, I am using the once() and count() functions but I don't really understand how these should work in this context and am even more confused by the fact that I have something that appears to work when previewed locally in Survey123 Connect but doesn't work when I publish the survey...
In the attached survey I have an outer repeat with a multiple choice question for treatments. The number of selected treatments is used to generate the number of treatment repeats (this works) and I'd like the treatment value to be populated in the treatmentName field (this doesn't work). Can anyone help me troubleshoot how to pull the treatment names into the repeats?
Also, this is a simple test example to learn how to do this. Eventually, I will be trying to edit an existing feature service with related records. I read that Survey123 webforms do not support nested repeats and I'm confused as this approach seems to be working (with the exception of automatically populating the fields). I would would be grateful for any clarification here!
Thanks in advance!