Select to view content in your preferred language

Survey123: Define a minimum repeat count

3514
3
Jump to solution
10-22-2020 12:17 PM
AllisonMuise2
Occasional Contributor

I am looking to specify a minimum number of records within a repeat in a survey. I know how to specify an exact number of records, but is there a way to say that any number of records is acceptable, as long as at least one repeat record is submitted?

I have several required fields within my repeat, but the problem is that users (general public using the web form) are clicking the '-' button at the bottom of the repeat section and deleting all their repeat records before continuing through the survey. They can then submit the survey with incomplete information because the required fields are no longer visible/validated. I believe they think this is button minimizes that section of the form.

Has anyone found a way to require at least one record in a repeat? 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

Yep I do this.  See my post in here  https://community.esri.com/thread/244944-limit-repeat-count-in-survey123-without-the-count-field-in-... 

Basically you have a field with a value of 1 then use count(field) to get the number of repeats.  Then you can put a constraint on that.

Hope it helps

View solution in original post

3 Replies
DougBrowning
MVP Esteemed Contributor

Yep I do this.  See my post in here  https://community.esri.com/thread/244944-limit-repeat-count-in-survey123-without-the-count-field-in-... 

Basically you have a field with a value of 1 then use count(field) to get the number of repeats.  Then you can put a constraint on that.

Hope it helps

AllisonMuise2
Occasional Contributor

Thank you! I was doing basically that, but using sum() instead of count(). Summing a field that doesn't exist  doesn't return a value (as is the case when all repeat records are deleted) so I was unable to get the constraint message to appear. Counting the responses instead of summing them works!

0 Kudos
RobertAnderson3
MVP Regular Contributor

It seems now you can set 'yes' in the required field on a repeat and it will work for the 'at least one' use case, however unfortunately it doesn't go beyond that for a specific number.