How To: Add a related table to a service while keeping the same Survey123 form and all data consolidated
Summary
Most changes to a survey form allow for republishing the survey without creating a new feature service or overwriting the feature service. However, adding a repeat to a survey does require creating a new service. This is well documented in the Survey123 Update Surveys documentation.
Procedure
Download the hosted feature service as a file geodatabase from Item Details page. This preserves related tables and attachments.
Add tables to the geodatabase for each repeat to add in the survey, and fields to the related tables that correspond to each question to add in the new repeats.
Make sure to add GlobalIDs and a blank GUID field to the newly created related tables, then create 1:M relationship classes between the primary feature class and the new tables on GlobalID (primary) > GUID (secondary).
Enable attachments on the related table to add image or audio questions to the new repeat. Make sure to do this after GlobalIDs have been created, as this creates the attachments table on the GlobalIDs (necessary for Survey123).
With the feature class and related tables in the Table of Contents in ArcGIS Pro, publish a new hosted feature layer. Enable editing on the layer from the Item details > Settings page in ArcGIS Online or when publishing.
Make a copy of the XLS form for the survey to be updated, to have a backup.
Add the new repeat to the survey tab, with questions corresponding to the added fields in the related table. The repeat name will be the name of the related table. Another important part here is that the question names match the field names in the table.
Optional: To assist in this process, it may be helpful to create a brand new survey from the hosted feature layer just published from Pro. The purpose of this is to obtain the submission URL value, and also cross-check the added question names. The submission URL and form ID can then be pasted into the original survey XLS form. However this is not a required step.
Publish the survey. If the new repeat questions have been matched successfully to the schema of the newly added related table in the hosted feature layer, the following screen is displayed, indicating that the existing survey will be updated:
Test by submitting a survey and examining the hosted feature service. You will see that all the original records are still there, but that you can also submit survey responses using the same survey form (make sure to refresh the form in the app), that capture the new repeat.
Last Published: 4/27/2022
Article ID: 000023485
Software: ArcGIS Online Current
Download the Esri Support App on your phone to receive notifications when new content is available for Esri products you use
Download the Esri Support App on your phone to receive notifications when new content is available for Esri products you use
Is This Content Helpful?
How can we make this better? Please provide as much detail as possible.