Hello,
We are building a form to submit samples to a laboratory for analysis. There are various different sites that would need sampled per permit. For each of the sites, we are trying to default the sampling bottles required, frequency of collection, and analysis required.
When the survey is submitted, the second site entered always duplicates the entries for the bottles, frequency, and analysis required. However, if you add a third site to the survey response, it doesn't duplicate. The site order doesn't matter, the second site always duplicates.
We are not sure how to fix it if you could please help! 🙂
note | generated_note_surveyDescription | <p style="text-align:center;">Name</p><p style="text-align:center;">CHAIN OF CUSTODY</p> | |||||||||||||||||||||||||||||||||||||
note | generated_note_form_submit_text | Submit | |||||||||||||||||||||||||||||||||||||
note | generated_note_form_footer | <a target='_blank' style='color:#ffffff;' href='https://www.esri.com/products/survey123'>Powered by ArcGIS Survey123</a> | |||||||||||||||||||||||||||||||||||||
note | generated_note_prompt_submitted | <p style="text-align:center;"><br></p><p style="text-align:center;"><img alt="undefined" src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjQiIGhlaWdodD0iNjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiMzMTg3MkUiIGN4PSIzMiIgY3k9IjMyIiByPSIzMiIvPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik0yMi42NjEgMzAuMjQ2bDUuMTgyIDQuOTg3TDQxLjU1MiAyMiA0NSAyNS40NjEgMjcuNzQ3IDQyIDE5IDMzLjQ5OHoiLz48L2c+PC9zdmc+"></p><p style="text-align:center;"><br></p><p style="text-align:center;"><strong style="font-size:16px;"><p style="text-align:center;">Thank you.</p><p style="text-align:center;">Your response was submitted successfully.</p></strong></p> | |||||||||||||||||||||||||||||||||||||
text | sampled_by | Sampled by | <p>(your first and last name)</p> | yes | This is a required question | 255 | |||||||||||||||||||||||||||||||||
text | client_name | Client Name | yes | This is a required question | Client | 255 | |||||||||||||||||||||||||||||||||
text | project_number | Project Number | Permit Number | 255 | |||||||||||||||||||||||||||||||||||
begin group | |||||||||||||||||||||||||||||||||||||||
begin repeat | Sites | Select Site | |||||||||||||||||||||||||||||||||||||
select_one list_site_code | select_site | Pick one: | |||||||||||||||||||||||||||||||||||||
text | sample_description | Sample Description | yes | ${select_site}='Other' | |||||||||||||||||||||||||||||||||||
geopoint | collection_point | Collection Point | ${select_site} | ||||||||||||||||||||||||||||||||||||
image | photograph_site | Photograph site | ${select_site} | method=camera | max-size=10 | ||||||||||||||||||||||||||||||||||
dateTime | datetime_sampled | Date/Time Sampled | ${select_site} | esriFieldTypeDouble | 255 | ||||||||||||||||||||||||||||||||||
select_one list_regulatory | is_sample_regulatory | Is sample collected for regulatory reporting purposes? | ${select_site} | ||||||||||||||||||||||||||||||||||||
select_one list_site_is_site_flowing | is_site_flowing | Is it flowing >1 gpm? | minimal | ${select_site} | 255 | ||||||||||||||||||||||||||||||||||
decimal | field_ph | Field pH | ${is_site_flowing}='Yes' | ||||||||||||||||||||||||||||||||||||
decimal | field_conductivity | Field conductivity | ${is_site_flowing}='Yes' | ||||||||||||||||||||||||||||||||||||
select_one list_site_is_flow_calculated | is_flow_calculated | Is the flow calculated? | minimal | ${is_site_flowing}='Yes' | 255 | ||||||||||||||||||||||||||||||||||
integer | estimated_flow_rate_gpm | Estimated flow (gpm) | ${is_flow_calculated}='No' | ||||||||||||||||||||||||||||||||||||
decimal | stream_length_ft | Stream depth (ft) | ${is_flow_calculated}='Yes' | esriFieldTypeDouble | |||||||||||||||||||||||||||||||||||
integer | stream_width_ft | Stream width (ft) | ${is_flow_calculated}='Yes' | esriFieldTypeDouble | |||||||||||||||||||||||||||||||||||
decimal | stream_velocity_ftsec | Stream velocity (ft/sec) | ${is_flow_calculated}='Yes' | esriFieldTypeDouble | |||||||||||||||||||||||||||||||||||
decimal | flow_rate_gpm | Flow rate (gpm) | round(448*(${stream_length_ft} div 2*${stream_width_ft})*${stream_velocity_ftsec}, 0) | ${is_flow_calculated}='Yes' | esriFieldTypeDouble | ||||||||||||||||||||||||||||||||||
select_one list_frequency | frequency_DSTF04 | Sample Collection Frequency: | Quarterly | ${select_site}='DSTF04' | 0 | ||||||||||||||||||||||||||||||||||
select_one list_frequency | frequency_USTF04 | Sample Collection Frequency: | Quarterly | ${select_site}='USTF04' | 0 | ||||||||||||||||||||||||||||||||||
select_multiple list_bottles | bottles_DSTF04 | Bottles: UFUA = unfiltered, unacidified : UFA = unfiltered acidified : FA = filtered acidified | 1L_UFUA,120mL_HNO3_UFA | ${select_site}='DSTF04' | 0 | ||||||||||||||||||||||||||||||||||
select_multiple list_bottles | bottles_USTF04 | Bottles: UFUA = unfiltered, unacidified : UFA = unfiltered acidified : FA = filtered acidified | 1L_UFUA,120mL_HNO3_UFA | ${select_site}='USTF04' | 0 | ||||||||||||||||||||||||||||||||||
select_multiple list_analysis | Analysis_DSTF04 | Analysis | Flow,Cond,pH,TSS,Alkalinity,Sulfates,Hot_Acidity,Iron,Manganese,Aluminum,TDS | ${select_site}='DSTF04' | 0 | ||||||||||||||||||||||||||||||||||
select_multiple list_analysis | Analysis_USTF04 | Analysis | Flow,Cond,pH,TSS,Alkalinity,Sulfates,Hot_Acidity,Iron,Manganese,Aluminum,TDS | ${select_site}='USTF04' | 0 | ||||||||||||||||||||||||||||||||||
end repeat | |||||||||||||||||||||||||||||||||||||||
text | field_76 | Special Instructions or Comments | |||||||||||||||||||||||||||||||||||||
image | relinquished_by | Relinquished by | <p>Please sign your name.</p> | signature | yes | This is a required question | |||||||||||||||||||||||||||||||||
select_one list_site_sample_drop | is_sample_drop | Is there a person to receive the samples? | yes | ||||||||||||||||||||||||||||||||||||
text | sample_secure | Sample was dropped at secure location. | Enter any other pertinent info about the samples' drop location. | ${is_sample_drop}="No" | |||||||||||||||||||||||||||||||||||
dateTime | datetime_relinquished | Date/Time Relinquished | yes | ||||||||||||||||||||||||||||||||||||
image | received_by | Received by | <p>Please sign your name.</p> | signature | ${is_sample_drop}="Yes" |
Solved! Go to Solution.
I couldn't get the form to load or publish until I fixed labels, group names, inappropriate use of repeat count column and removed an extra "end group" at the bottom of the xlsx. I tested it in Connect and also as a published survey in Survey123 and it behaved as designed. The only duplication I could see of the Frequency, Bottles, and Analysis fields is because you have default values set for each of those. That will cause the repeat to "duplicate" because it sets those as the defaults for each new repeat, but additional selections did not carry over between repeats.
There were some invalid cell values in the xlsx (empty fields that it didn't like until you clicked and hit delete) and some incompatible "type" and "bind::esri:fieldType" settings. I fixed most, your stream width still needs fixed since the type is "integer" and the esri field type is "double". For your relevant expressions I changed them from the ${field_name}="X" to the best practice selected(${field_name}, "x"). I attached the cleaned up version for you to test out.
Do you have an end group? I also give groups a name and label (even if just <b></b>), although not sure that's mandatory. Do you have any calculations or other stuff going on?
Would you be able to upload the xlsx for the form? It is hard to figure out where your formulas are supposed to be since the embedded table doesn't have any headers.
I'm surprised you aren't getting an error in the survey since it looks like your "select_site" field has no label name for it.
Hello, I have uploaded the xlsx in the reply above. I do get an error for not labeling the select_site but it doesn't seem to impact the actual survey and I can publish it.
Greatly appreciate any help you could give! 🙂
Thanks!
I couldn't get the form to load or publish until I fixed labels, group names, inappropriate use of repeat count column and removed an extra "end group" at the bottom of the xlsx. I tested it in Connect and also as a published survey in Survey123 and it behaved as designed. The only duplication I could see of the Frequency, Bottles, and Analysis fields is because you have default values set for each of those. That will cause the repeat to "duplicate" because it sets those as the defaults for each new repeat, but additional selections did not carry over between repeats.
There were some invalid cell values in the xlsx (empty fields that it didn't like until you clicked and hit delete) and some incompatible "type" and "bind::esri:fieldType" settings. I fixed most, your stream width still needs fixed since the type is "integer" and the esri field type is "double". For your relevant expressions I changed them from the ${field_name}="X" to the best practice selected(${field_name}, "x"). I attached the cleaned up version for you to test out.