I have two surveys that share a hosted feature service (AGOL Item ID 59ba332b1c0a43bba9285fb260361d2c). The first survey is defined like so with no fields filled other than what is shown:
The second survey is defined like so:
The second survey has the inbox enabled (no filter) but is otherwise using the default configurations.
When I collect a new Survey 1 survey, enter a value for the field in the repeater, submit the survey, open Survey 2, refresh the inbox for Survey 2, and open the survey that I just submitted, I am not able to enter data into the second repeater. It looks like this:
I've used the AppStudio Survey123 Enterprise Template to debug this and tracked it down to this being due to the repeat2_count field being undefined when Survey 2 opens. Is this a known bug? I would expect to be able to enter data for Repeat 2.
Solved! Go to Solution.
Hi Christopher,
This is arising from the use of the repeat_count, which adds a field (in your case, collect_number2_count - please check the feature layer to verify) to the form to store the number of allowed repeats. Because it isn't in the first form, it has a null value when read in the second and disallowing any repeats in for collect_number2. You should be able to resolve this by adding a hidden field to the first form with the name collect_number2_count and set its default value to 1.
Hi Christopher,
This is arising from the use of the repeat_count, which adds a field (in your case, collect_number2_count - please check the feature layer to verify) to the form to store the number of allowed repeats. Because it isn't in the first form, it has a null value when read in the second and disallowing any repeats in for collect_number2. You should be able to resolve this by adding a hidden field to the first form with the name collect_number2_count and set its default value to 1.
James Tedrick Have you had a chance to look at the second issue I raised. We've run into it on the project I'm working on now and haven't been able to find a good solution.
Hi Christopher,
It sounds like you may not want to use the repeat_count in the setup you outline as your second scenario - that is used to enforce a set number of repeats during a collection process. If the process has multiple steps which allow for arbitrary values, there could be uncertainties with the repeat count - whether it pertains to all records or new records. You could use a count() function with a note or question to raise an alert or constraint regarding the number of repeats if that is needed in the form logic.
Thanks James Tedrick, that is a decent workaround that allows me to add items in my repeater in Survey 2. However, I noticed that setting the _count field value in the first survey causes the repeat_count value to be overwritten in the second survey. So if I set collect_number2_count to 1 in Survey 1 and the repeat_count value to 3 for the repeater in Survey 2, then I am only able to add 1 record in Survey 2 instead of 3. Now in this example use case it's not a big deal to set collect_number2_count = 3 in Survey 1 but if I have a third survey with different requirements for the number of records in this repeat, then this workaround starts to break down. Can a bug be created for the Survey123 team to find a better solution for this?