How to Add New Questions/Fields to Existing F/S Survey in S123 Connect

1803
11
06-27-2019 06:25 AM
MelissaWojciuk
New Contributor III

I created a survey as a related table to an existing point feature class and am using Collector and custom URLs to populate fields within the survey.  However, now the department using the survey would like a couple new questions added so that they can track which surveys they have audited for data accuracy & training purposes.  Is it possible to add new fields to the existing feature service?  Would I use the admin page and 'Update Definition' to modify the JSON to add the new fields so I can add the new questions to the survey?

I used this process to create the survey:  https://community.esri.com/thread/230438-how-do-i-make-my-survey123-survey-a-related-table-to-a-feat...

0 Kudos
11 Replies
IsmaelChivite
Esri Frequent Contributor

Hi. You can add new fields to your hosted feature layers as described here: Add or delete a field—ArcGIS Online Help | ArcGIS  If the feature service was published from ArcGIS Pro or ArcMap, I am not entirely clear how you can safely add a new field without losing your data. I suggest you ask in the ArcGIS Online and/or Enterprise GeoNet places in case you do not get ideas from this forum.

Once the field has been added, you can manually add the corresponding Survey123 question in your XLSForm.  For more info on how to map XLSForm questions to ArcGIS fields, see: https://community.esri.com/groups/survey123/blog/2015/08/24/xlsform-mappings-to-arcgis-feature-servi... 

0 Kudos
MelissaWojciuk
New Contributor III

Hi Ismael,

Thanks for the response! Unfortunately, the options for adding a field are not available (I did publish the service from Pro).  Before the Survey went 'live', I was able to add & modify fields, but now that option is no longer available to me. However, I was able to successfully edit some field alias names using the 'Update Definition' and editing the JSON, but I was not certain if this process could also be used to add a new field. (using this as a guide: https://www.esri.com/arcgis-blog/wp-content/uploads/2014/10/How-to-Update-Hosted-Feature-Service-Sch... )

Thanks!
Melissa

0 Kudos
MikailaBell
New Contributor III

It does not matter where you published. You MUST add the field(s) in ArcGIS online, and make sure the added schema details match the questions you are adding to the survey in Pro or S123.

0 Kudos
MelissaWojciuk
New Contributor III

Thanks Mikaila! I'm stuck on how to add the field in AGO.  I'm guessing (and maybe I'm wrong in this) that the Survey "_Stakeholder" Feature Layer that is associated with my Feature Service is preventing me from being able to add a new field to my FS in AGO??  Normally adding a new field in AGO is pretty straightforward, go to the Data view, Fields, and there's an option to Add a New field, change domains etc.  However, those options are not available anymore and I'm not sure how to go about adding a new field without these options.  I even tried adding a new field to the FS in Pro, but received an error that the FS was in use.  Thank you! Melissa 

0 Kudos
MikailaBell
New Contributor III

To add a field to your existing feature service in AGOL, follow these steps.

1. Locate the layer in your content (you need to be the owner/publisher, I believe)

2. View the item details

3. Select the Data tab

4. Switch from Data to Fields on the selector at the top

5. Choose "Add Field" 

6. Configure the field as desired

7. Save 

EDIT: Please note, if you have a view layer (e.g. a stakeholder viewing layer) set up, you will need to add the field to the source. If the view layer does not automatically update after a few minutes, you may need to add the same field to the view layer. 

0 Kudos
MelissaWojciuk
New Contributor III

Hi Mikala-thanks so much for the help! I looked at the feature service to another survey we have and the 'Add Field' option is available.  However, on this survey (which was created using an existing feature service, and writes to a related table) the 'Add Field' option is NOT available. And this is looking at the main/source Feature Service and not the Stakeholder view layer.  I'm not understanding why the add field is not available? Any help is appreciated!! thanks!

MikailaBell
New Contributor III

Hi Melissa,

It sounds like you are working with a "View" layer of the original dataset. That's what "stakeholder" usually means -- it's a live copy, a view layer, mirroring the actual survey's target feature service.

Here's how you will know for sure. From the details page for your layer in AGO, does it say "Feature Layer (hosted, view)" or simply "Feature Layer (hosted)". If you have the former, it's a view layer. You will need to make the Add Field to the source of that view layer, the original feature service that is being mirrored.

Good luck!

0 Kudos
MelissaWojciuk
New Contributor III

It is the "Feature Layer (hosted)", which is why I'm so confused  I know I had the ability to add fields to this Feature Layer in AGO before the survey was being used by the field, but once the survey started being used/edited by the field, the option to add fields went away.

0 Kudos
MikailaBell
New Contributor III

Oh no! In that case, maybe try via the webmap? Do you have the options in this article?: https://support.esri.com/en/technical-article/000012167 

0 Kudos