Select to view content in your preferred language

Adding new field to published survey using existing feature layer and table.

2049
11
Jump to solution
04-17-2023 10:23 AM
GarrettRSmith
Occasional Contributor II

Hello All.

I am trying to add two new questions (fields) to a survey that was published last year that points to a hosted feature layer and three tables (forms). After adding the fields in the XLSForm from Survey123 Connect, I get the following message:

Screen Shot 2023-04-17 at 10.13.07 AM.png

Here are the two fields I am trying to add, highlighted in yellow:

Screen Shot 2023-04-17 at 10.14.00 AM.png

Do I need to add these fields in the form first? 

I have seen other posts, where people are able to add fields when publishing the edited survey, but I am not receiving that option when I try to publish.

Thanks for any help.

 

0 Kudos
1 Solution

Accepted Solutions
BarbaraWebster1
Esri Regular Contributor

@GarrettRSmith, yes it appears that this is the only way to unlock the schema when there are views that participate in joins (also see the last section of this blog). You could also check in with the ArcGIS Online Community.

Thanks,
- Barbara

View solution in original post

0 Kudos
11 Replies
BarbaraWebster1
Esri Regular Contributor

Hi @GarrettRSmith,

It isn't possible to automatically add new fields to the feature layer when you're republishing a survey that uses a submission_url. 

You can either add the new fields directly to the feature layer via ArcGIS Online and then add the corresponding question to your survey and republish, or if you have access to the original survey that generated the survey, you can add the questions to that survey and the new fields will be added during republish. You would then need to also add the new questions to the survey with the submission URL. 

Also, it looks like you are using an older version of Connect - we added some additional republishing functionality in the October 2022 (3.16) release that allows you update domains (used for select_one questions) on republish (for non-submission URL surveys). It also provides more detailed feedback if there are any discrepancies between the questions in your survey and the fields in the feature layer.   

Thanks,
-Barbara

GarrettRSmith
Occasional Contributor II

Hello @BarbaraWebster1 

Thank you for the response.

I am using an older version of Connect because I only own an Apple MacBook and there are no new versions for OS. I will see if I can use my wife's laptop with the new version of Connect.

I do have a master survey that I used to create the survey in the example. It also has two other surveys that I created in a similar manner. Taking the master with repeats, publishing it, then creating three survey versions that only point to the feature layer and the affiliated form.

If I update the master survey, will it mess with any of the data that has been collected? I have about 3,000 observations that were collected last field season and I do not want to mess with that. It is fine to add a new field to them, since I can just add Nulls to them for previously collected data. 

Thanks again, and please let me know if you need any clarification.

 

0 Kudos
BarbaraWebster1
Esri Regular Contributor

@GarrettRSmithAdding a new question in the main body of the survey and then republishing will not require the survey feature service to be overwritten, so it will not impact existing data. There's a table here in the Survey123 documentation that lists which changes you can make to the survey without overwriting the feature service.

Note that it's not possible to add a new repeat without overwriting the feature layer. Also there was a limitation in older versions of Connect regarding adding a new question to a repeat, so if you need to make that change you may want to add the field through ArcGIS Online, or use a newer version of Connect.

As the documentation mentions, it's always a good idea to export a backup file geodatabase of your results before republishing. 

0 Kudos
GarrettRSmith
Occasional Contributor II

Hello @BarbaraWebster1

I downloaded Connect onto my wife's Windows computer, created the new fields, and clicked through the options as outlined below, selecting the button that will add the fields and domain values:

addfield_01.png

addfield_02.png

However, when I go to publish the survey, it gets stuck on the following screen:

addfield_03.png

I am going to try updating from someplace else, if this is an internet issue. But, in the meantime, I was wondering if there is something I should be looking at to resolve this issue.

Thanks 

0 Kudos
BarbaraWebster1
Esri Regular Contributor

@GarrettRSmith Collecting a diagnostic log may help with identifying the cause of the hang during publishing. 

0 Kudos
GarrettRSmith
Occasional Contributor II

Hello @BarbaraWebster1 

I ran the diagnostics log, and this is where I think that the error is occurring based on the log:

<10>1 2023-05-05T23:48:09Z LenovoOriginal ArcGISSurvey123Connect 1436 - [AppStudio@11205 category="PortalRequest" function="onFailed" filename="PortalRequest.qml" line="149"] PortalRequest: PortalRequest failed url: https://services1.arcgis.com/1IDA5eF9OC4MOzUt/arcgis/rest/admin/services/service_ecf8089afc00407c9d3... error: {
"code": 400,
"details": [
"Not supported. Schema changes are not allowed for service - service_ecf8089afc00407c9d3943a360bbb11b."
],
"message": "Unable to add feature service layer definition."

I am also unable to manually add a field in ArcGIS Online:

table2.png

Is there something I might be overlooking?

Thanks for all of your help.

0 Kudos
BarbaraWebster1
Esri Regular Contributor

Hi @GarrettRSmith,

If your feature layer has view layers that participate in joins, this could cause schema locking. This article may be a useful reference: https://www.esri.com/arcgis-blog/products/arcgis-online/uncategorized/bring-your-data-closer-togethe.... The 'Things to consider' section mentions the schema locking behavior.

Thanks,
-Barbara

0 Kudos
GarrettRSmith
Occasional Contributor II

Hi @BarbaraWebster1 

Thank you so much for the link. I think the issue with the schema locking behavior is due to the joins that I have in the data :

Screenshot 2023-05-14 at 5.07.21 PM.png

I have joined the feature class (points) with the correct tables:

Screenshot 2023-05-14 at 5.10.04 PM.png

Should I delete these feature views to unlock the schema? They are currently being used on a Dashboard but I suppose I can re-create them if needed.

Thanks

0 Kudos
BarbaraWebster1
Esri Regular Contributor

@GarrettRSmith, yes it appears that this is the only way to unlock the schema when there are views that participate in joins (also see the last section of this blog). You could also check in with the ArcGIS Online Community.

Thanks,
- Barbara

0 Kudos