Select to view content in your preferred language

Avoiding the submission of duplicate features in QuickCapture

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

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
JulioOlivarez
Occasional Explorer

Thank you for this information. Is my understanding correct that there is no way of preventing the error message if no success message is received from the server? I'm currently dealing with an issue where a failed to send error is received when sending data even when the data is successfully sent. 

JohnathanHasthorpe
Esri Regular Contributor

@JulioOlivarez - Are you using enterprise? If so, what version?

If we get no messages from the server (online or enterprise) the app tries to send 3 times. If it gets no response back after 3 attempts the app will show the error. It is then up to the user to retry, use the recovery workflow or discard. 

It would be good to find out why the app is not getting a response back. Are you submitting in poor connectivity?

JulioOlivarez
Occasional Explorer

@JohnathanHasthorpe I am not using enterprise. I am submitting with strong connection, I collect data in the field with no connectivity and then return and connect to a WiFi network for submission. We've tested the project on multiple devices with the same result and even had the same error when a new project was created using the same feature layer. The other projects we utilize have been working as normal, it's just this one that is having the issue.

JohnathanHasthorpe
Esri Regular Contributor

@JulioOlivarez - Please drop me an email on quickcapture@esri.com - I'd like to help trouble shoot this.

Thanks

John

lannguyentl
Regular Contributor

Hi @JohnathanHasthorpe , 

I have been following your posts, and they are awesome. We keep eyes on the data coming in from QuickCapture to our AGE (11.1) hosted fs. We have not had issues with multiple records submitted. We do have others:

1. Webhook do not work for data captured by QuickCapture in "offline" and then submitted when coming back to "online". Should be a bug in hosted database?

 

2. Randomly, a record in QuickCapture can have multiple identical attached photos. (same name, same filesize)

lannguyentl_0-1743025315138.png

 

Have you or anyone had these issues?

Thanks,

Lan

VickyS
by
Frequent Contributor

@JohnathanHasthorpe, We are experiencing this issue regularly. Users are using version 1.22.6 and 'SupportsApplyEditsWithGlobalIds'  is set to True on the feature service.  

The server logs are reporting duplicate entries and the app is refusing to let users press the cancel button when they are prompted to send via email.  The duplicates relate to records collected offline, it is like the app is not acknowledging that is has sent them when signal is regained. They just sit on the app and it tries to send them again and again.

Any work arounds would be greatly appreciated. We are currently asking users to email data in and then delete and redownload the project.