Issue with Required Fields Inside a Repeater

4733
21
09-19-2016 05:27 PM
JakeMatthys
Occasional Contributor II

I have a survey which has some required fields, the survey also has a number of repeaters and these repeaters also have required fields.  The form has a multi select and each repeating option is relevant to the multi select.  So if the user selects 3 items, lets say pipes, valves and hydrants, the user will get 3 repeating sections to populate.  We are experiencing an issue where the required fields are enforced in the first repeater, but is not enforced in subsequent repeaters.  In the first repeater, if all required fields are populated, the form can be submitted, if not, the form identifies the required field that needs populated.  This holds true for all repeat occurrences within that first repeater.  In the subsequent repeaters the required fields are not validated by the UI.  What we are finding is that as long as the user has populated all the required fields in the main form and in the first repeating section, required fields that have not been populated in subsequent repeater sections are submitted by the form.  I would expect the form to not submit and to warn the user that required fields have not been populated.  

Has anyone else experienced this issue?  I have uploaded the excel form document if anyone would like to take a look.

Thanks,

 - Jake

Tags (2)
21 Replies
MitchellProctor
Occasional Contributor II

Hi Jake,

There are long-standing known issues using required fields in repeats. We hope to fix them in a release in the near future.

0 Kudos
JakeMatthys
Occasional Contributor II

Thanks for the info Mitchell.  Please keep us posted when you believe the issues with required fields in repeaters is resolved.

0 Kudos
Nicole_Ueberschär
Esri Regular Contributor

Here Required Fields ignored in repeats · Issue #226 · Esri/Survey123Community · GitHub  it sounds like the problem was solved but obviously it wasn't... (Having similar problems with required fields in repeats. It's working in Connect but not in the app...)

0 Kudos
JakeMatthys
Occasional Contributor II

Just wanted to give a bump to this issue.  We have approximately 25 surveys in use and our only gripe is that required fields inside of repeaters are not being enforced.  Thanks for hearing out our concern and hopefully a fix is coming in the near future.

 - Jake

IsmaelChivite
Esri Notable Contributor

Hi Jake.  Thanks for sharing your survey. It really helps a lot having it to understand the problem.  We need to look more closely into this and figure we can logically make this work. At this point, I am not clear that we can fix this behavior, without breaking other workflows. This scenario is a it tricky because the relevant statement is applied to the repeat... we need to think about this one.

Can I suggest that you set a default value for your PASS_FAIL select_ones? If you can do that, the survey behaves as you would expect:

  • If no inspection type is selected, then no data is submitted in the repeat.
  • If you check an inspection type, then at least one inspection is submitted using the provided values (by default or user-input).

On a different topic, it looks strange that one could submit a form without selecting at least one inspection type. May be you want to add a constraint to UG_INSPECTION_TYPE to ensure at least one option is checked? Something like count-selected(${UG_INSPECTION_TYPE})>0

JakeMatthys
Occasional Contributor II

Thank you for the recommendations Ismael.  We will test the default values and let you know if that solution will work for us.  Also, thanks for the recommendation on the inspection_type constraint using the 'count-selected' function.

 - Jake

0 Kudos
JakeMatthys
Occasional Contributor II

I would like to follow up on this issue as it relates to repeaters with required fields and the repeaters are exposed to the user based on the relevant answers to previous questions.

Unfortunately we did not find that using default values in all of the repeaters that meet the above criteria as a valid solution for our use case because we would have overhead in terms of managing the default values and checking for the default value presence to exclude them from downstream reporting.

The two main issues that we have encountered with repeaters that have required fields and the repeaters are exposed to the user based on relevant answers to previous questions. (version 1.9.24):

  1.  A survey that has a repeater with required fields, but that has not been exposed to the user because the repeater has a relevant that was not satisfied, will prevent a survey from being submitted
  2. In a situation where a survey has multiple repeaters, each with required fields and each repeater is relevant on a previous question.  In the case where more that 1 repeater is relevant (based on users previous answers)  as long as 1 of the repeaters has all of the required fields satisfied, than the required fields in the other repeaters are ignored.  Meaning that the required fields in the other repeater do not behave, you can leave some of the questions null and the survey will still submit.
0 Kudos
IsmaelChivite
Esri Notable Contributor

Hi Jake. Just wanted to drop you a  note here to highlight that we are actively looking at this issue.

0 Kudos
IsmaelChivite
Esri Notable Contributor

Hi Jake Matthys‌, this issue should now be addressed with version 1.10. Check announcement at https://community.esri.com/groups/survey123/blog/2016/12/20/international-human-solidarity-day-relea...