Select to view content in your preferred language

Avoiding the submission of duplicate features in QuickCapture

706
6
12-16-2024 07:45 PM
JohnathanHasthorpe
Esri Regular Contributor
2 6 706

We have seen cases where duplicate features were submitted by the QuickCapture mobile application. This issue typically was experienced in areas with poor network connectivity. In some cases, the users saw timeout errors, while in other cases, they may not be aware of the duplicate submissions.

Cause of the issue

The problem occurs due to the app's logic, which aims to prevent data loss. When the app attempts to upload a feature (or batch of features), it waits for a success response from the server. If no response is received, the app assumes the upload has failed and will attempt to retry the upload twice more. If there is still no response, the app will show an error to the user. The user can then manually attempt the submission as many times as they like.

The issue arises when a feature is actually successfully uploaded, but the app does not receive a response in time. In such cases, the app may mistakenly retry the upload, resulting in duplicate feature submissions.

In the past, we accepted this as a trade-off to avoid data loss. However, the latest version of the application introduces a new mechanism to prevent this issue.

Solution

In the latest version of the QuickCapture app (1.21), a unique GlobalID is created for each submitted feature. If a feature with the same GlobalID is submitted again, the server will return an error. When the app detects this specific error, it will treat the feature as successfully submitted and will not attempt to resubmit it.

Enabling the supportsApplyEditsWithGlobalIds capability in hosted feature services

All you need to do is update to the latest version of the mobile application (1.21 or higher) and ensure that all your feature layers have the supportsApplyEditsWithGlobalIds capability enabled. This capability allows the app to create and assign a GlobalID to each feature before sending it, instead of relying on the server to generate the GlobalID on submission.

Check if your feature service supports the capability:

  • In the QuickCapture web designer, select a project button and navigate to the DATA tab.
  • Click the (i) icon to open the item page for the feature layer the button is sending features to.

JohnathanHasthorpe_3-1734404497979.png

    • Scroll down to the URL section for the feature layer and click the View button.

JohnathanHasthorpe_4-1734404563919.png

 

  • This will open the ArcGIS REST Services Directory page for the feature service. Look for the SupportsApplyEditsWithGlobalIds property and ensure it is set to True.

JohnathanHasthorpe_5-1734404594347.png

 

Enable the capability in a hosted feature service:

  • If the property is not set to true, go back to the feature layer’s item page and click the Settings tab.

JohnathanHasthorpe_6-1734404700614.png

 

  • Scroll to the Editing section, check the Enable Sync option, and save the change. This will create the required fields and indexes, and set SupportsApplyEditsWithGlobalIds = true.

JohnathanHasthorpe_7-1734404750972.png

 

  • Note: This is a one-way process; you can uncheck Enable Sync later if it is not necessary for your workflows.

Finally: in the QuickCapture web designer, re-save the project. Users in field will then be able to download the project update. That is it, you are done. No more duplicate features in your feature service!

Bonus: More reliable sending of attachments

When a target feature service is configured with SupportsApplyEditsWithGlobalIds = true, QuickCapture mobile users will also experience the more robust sending of attachemnents (photos or videos). Esentially, the mobile application will upload attachents first, and only when all attachments have been successfully uploaded, will it send the feature. This means that you should not get a feature that has been submitted with missing attachments, which is still possible for layers that have SupportsApplyEditsWithGlobalIds = false.

That is it for now. Happy QuickCapturing!

 

 

6 Comments