How to enable supportsApplyEditsWithGlobalIDs on your feature layer

38231
37
07-17-2018 09:06 AM
IsmaelChivite
Esri Notable Contributor
14 37 38.2K

[Published July 17, 2018]

[Updated July 21, 2018]

[Updated July 31, 2018]

[Updated October 8, 2018]

This blog post is for those of you that have upgraded the Survey123 field app to version 3.0 and realized that your surveys can no longer submit data to your feature layers. 

Here is a screenshot of the error that the Survey123 3.0 field app will show when working against a feature layer with no supportsApplyEditsWithGlobalIDs.

If your surveys do not show evidence that supportsApplyEditsWithGlobalIDsis a problem, then you should ignore this blog post.


A little bit of context

As described in our https://community.esri.com/groups/survey123/blog/2018/07/06/bull-release-30 announcement, the Survey123 3.0 field app no longer can submit data to feature layers where the supportsApplyEditsWithGlobalIDs property is set to false.  This is a somewhat obscure property that cannot be simply be turned on with the push of a button. Instead, it switches on automatically when your feature service meets a number of requirements:

  • All layers within the feature service must have an indexed GlobalID field.
  • All relationships (layer to layer, layer to table, layer to attachments, table to attachments) must use GlobalID fields (as opposed to ObjectID fields).
  • If using an enterprise geodatabase, the feature service cannot include versioned feature classes.
  • If using Portal for ArcGIS, only versions 10.4 and newer support this property.

The reason why Survey123 requires supportsApplyEditsWithGlobalIDs is that this setting is critical in order to guarantee clean transactions when uploading attachments (particularly when working in low bandwidth conditions) and also to support nested repeats.

We are aware that many of you have feature services where supportsApplyEditsWithGlobalIDs could not be enabled immediately, so we made available a backwards-compatibility build of Survey123 2.9 (also referred to as Survey123 Classic), which has been made available on Windows, Android and Mac.  Apple has not yet approved this build in the store so far, but in exceptional cases Esri could provide access to older builds as a temporary measure (Please contact Esri Tech Support for that).

To download Survey123 Classic (2.9), use the version switcher in the top-right corner of our Survey123 for ArcGIS | ArcGIS Download page.

Survey123 2.9 (Classic) is a temporary solution for all of you who can't really adjust to the requirements of version 3.0.  In this blog post I will describe a couple of approaches to enable supportsApplyEditsWithGlobalIDs in your feature layers so you can work with 3.0 against your existing layers.

Before embarking into these steps, consider if you really need your surveys to work against existing layers. In many cases, you can simply publish a new version of your survey with Survey123 Connect and have field users download your new survey.

If you want to keep Survey123 3.0 (and other previous versions) working against your existing layers, then read on...


How to check if supportsApplyEditsWithGlobalIDs is enabled in your feature layer

The supportsApplyEditsWithGlobalIDs property is not advertised through the user experience in ArcGIS Enterprise or ArcGIS Online .  This property is only visible within the json definition of your feature service.

  • In ArcGIS Online or your portal in ArcGIS Enterprise, navigate to the Page Details of your Form and click on the Form Layer to open the Feature Layer behind your Form.
  • Next, open the Services Directory view of your Feature Service and display it as JSON.
  • Look in the JSON for the supportsApplyEditsWithGlobalIDs

You cannot simply edit the supportsApplyEditsWithGlobalIDs property. This property only turns true when certain requirements in your Feature Service are met as described in this blog post.

Working with Hosted Feature Layers in ArcGIS Online and Enterprise

If your feature service does not have attachments or relationship classes: This is the easiest scenario. To enable supportsApplyEditsWithGlobalIDs, simply enable the sync capability in your feature service. This can be done through the Settings of the feature service.  From ArcGIS.com go into your Content, navigate to your survey folder and look for the Feature Layer (not the views!). Then open the Item Details page and go to Settings. The Enable Sync capability is inside the Feature Layer (hosted) section. Do not forget to hit Save after you check Sync.

Enabling the Sync capability will automatically create and index GlobalId fields in your feature layer and supportsApplyEditsWithGlobalIDs will switch to true. Once you have enabled sync, you can turn it off.  The Sync capability will not have a negative performance impact on your feature layer, but you will not be able to disable queries in your layer if Sync is enabled.  This is one of the main reasons why you may want to keep Sync disabled.

If your feature service has attachments and/or relationship classes: In this case, we need to overwrite your feature service with a geodatabse schema that includes one uniquely indexed GlobalID field per every layer and table in your service.Additionally, all attachment relationships must be based on GlobalID fields..  The following steps illustrate how to do this, without losing any data you may already have.

  1. In ArcGIS  or your portal in ArcGIS Enterprise, navigate to the Page Details of your Form and click on the Form Layer to open the Feature Layer behind your Form.
  2. Download your Feature Layer data in File Geodatabase format and add the entire contents of the File Geodatabase into ArcGIS Pro.
  3. In ArcGIS Pro, run the Add Global IDs geoprocessing tool on all layers and tables in your File Geodatabase.
  4. In ArcGIS Pro, run the Migrate Relationship Class geopocessing tool against attachment relationship classes in your File Geodatabase.
  5. In ArcGIS Pro, run the Disable Editor Tracking geoprocessing tool against your File Geodatabase data.
  6. In ArcGIS Pro, set all the Editor Tracking fields in your File Geodatabase to "Read Only" using the Design/Fields view as shown in the next animation.
  7. Overwrite your Form Feature service using the Share/Web Layer/Overwrite Web Layer option in ArcGIS Pro.
  8. In your portal in ArcGIS Online or ArcGIS Enterprise, Enable Editor Tracking (in the Setting Dialog of your feature service as shown in the next screenshot) in the Form's Feature Layer.

Make sure you enable Keep Track of who created and last updated features. Do not get confused with the Keep track of created and updated features.

Working with Non-Hosted Feature Layers in ArcGIS  Enterprise

For ArcGIS Enterprise, there are some situations where supportsApplyEditsWithGlobalIDs cannot be set to true in a Feature Service. This is the case, for example, when your Feature Service works on top of versioned data or tables not registered in a geodatabase. Installing Survey123 2.9 (Classic) would be the only solution possible unless you unversion your data or move your data into a non-versioned geodatabase feature layer.

Other than the exceptions above, here are steps to enable supportsApplyEditsWithGlobalIDs in ArcGIS Enterprise for non-hosted feature services:

  1. Add all layers and tables included in your Feature Service into an ArcGIS Pro session.
  2. In ArcGIS Pro, run the Add Global IDs geoprocessing tool on all layers and tables included in your Feature Service.  It is very important that the new GlobalID fields are indexed using a unique constraint.
  3. If your feature service includes attachments: In ArcGIS Pro, run the Migrate Relationship Class geopocessing tool against attachment relationship classes included in your Feature Service.
  4. Overwrite your existing feature service to ensure that added GlobalID fields are now exposed through your Feature Service, by making them visible.

If after doing all the above, you still cannot see that supportsApplyEditsWithGlobalIDs is enabled, then you can try the following:

  1. Overwrite your service definition ensuring this time that the sync capability is enabled.
  2. Enable archiving in your layers and overwrite your service definition.

Technically, Archiving and Sync are NOT required but they will ensure all your GlobalID fields are properly indexed.  Once supportsApplyEditsWithGlobalIDs has been switched to true, you should be able to disable archiving and sync if you like. 

Please note that while sync will not cause any performance degradation or overhead on your feature service, archiving might.  If sync is enabled, you will not be able to disable queries in your feature layer.
37 Comments