Answers changing to blank or undefined when choice filter to same question in subsequent repeat is activated (S123 web form)

455
2
04-30-2020 08:57 AM
DataOfficer
Regular Contributor

We are launching a survey tomorrow using a Survey123 web form, published from Connect. In browsing through some test data colleagues have entered, I noticed that some answers for a particular question are being recorded as 'undefined'. This seems to only occur when the user is completing multiple repeats. In my own testing, I have now noticed that when I start entering data in to a second (or third, fourth etc....) repeat, the answer to the question (what Species did you see) in the previous entry becomes overwritten to a blank value. When checking the results, these fields are either left blank, or recorded as 'undefined' (screenshot attached), when they should contain the species name. In some instances, going back to a previous repeat to try and fill out the answer again after it has been removed by the subsequent repeat shows a greyed out box that cannot be filled in (screenshot attached). The only reason I can think this may be occurring with this particular field is because it uses a coalesce argument in the calculation column (workflow described below) or because the question is dependent on a choice filter / cascading select. This issue does not seem to occur if only a single repeat (i.e. the original repeat) is filled in. The form can be accessed publicly at https://survey123.arcgis.com/share/046b1389d4884f659e06baafba1119eb for reference.

Workflow leading up to the error:

Within a repeat

  • User select what sort of species they have seen - the species group (e.g. frog, lizard, snake), from a question called spgroup
  • User selects species from dropdown list, with choices based on a choice_filter (SpeciesGroup=${spgroup}) from the previous selection
  • If the user selects 'other' as the species, a new text entry opens (field name: 'Species_Other') allowing free text for the species name
  • Hidden in the background, a second 'Species' field (named 'SpeciesCo') uses a coalesce argument to store the species / other text choice: coalesce(${Species_Other},${Species_label})
  • If the user selects a predefined species from the list (e.g. common lizard), a pulldata calculation pulls in some other attributes (e.g. Scientific name) from an external csv to some hidden fields.

Breakdown of the erroneous behaviour:

  1. In repeat 1, the user fills out the details including the species group and specific species choice
  2. In repeat 2, the user fills out the details including the species group and species choice. The species entry for repeat 1 becomes blank once the second species group ('spgroup') choice in repeat 2 has been made. The user can go back and select the species in repeat 1 again to fix it.
  3. In repeat 3, the user fills out the details including the species group and species choice. The species selection in repeat 1 becomes blank again (if it was fixed after repeat 2), and the species selection in repeat 2 becomes greyed out with no way of entering data. The user can go back and select the species in repeat 1 again to fix it.
  4. Repeats 4 onwards result in the same behaviour with all but repeat 1 Species entries becoming greyed out and inaccessible, and again erasing any species entry that was in repeat 1. Note that in the last repeat, it still pulls in the correct information via the pulldata calculation (see below).

In the results, this is stored as follows (with some dummy data) - errors shown in red:

Repeat numberspecies group (spgroup)Species (SpeciesCo)Scientific name (via pulldata function)
1Frog/toadcommon frog (correct because this was filled in again after the last repeat removed it, but otherwise would be blank or show as undefined)Rana temporaria
2Newt/Salamanderblank (actual selection was smooth newt)blank
3Snakeblank (actual selection was grass snake)blank
4Lizardundefined (actual selection was slow-worm)Anguis fragilis

#coalesce #repeat #Survey123 #webform #webapp #undefined

0 Kudos
2 Replies
BrettStokes
Esri Contributor

Hi Rob,

Did you ever find a solution for this? Please share if you did. I'm wondering if you have tested your survey in the field app? I understand you're using the web form but it may help uncover and equivalency bug if the issue only exists in the web form.

Thanks,

Brett

0 Kudos
DataOfficer
Regular Contributor

Hi Brett,

I ended up raising this as a support case (#02547150). The case resolution was it was a bug (BUG-000131208): 'Relevant calculation causes the selected cascade choice to disappear for the first repeat after filling in information within a second repeat (Survey123 web form)'. In the meantime I have had to put some workarounds in place until it is resolved.

Best wishes,
Rob