Select to view content in your preferred language

Prevent Duplicates During Survey123 Submittal Process

4604
6
05-07-2020 01:11 PM
BillMacPherson
Regular Contributor

My goal is to prevent duplicate survey records from getting entered into the hosted feature service. I would like for the survey submittal to act similar to a database form when you try to insert a record with a duplicate key, it throws an error and aborts. I would like the survey to check for a unique ID to see if it already exists in the feature service records. If it already exists then an error message is presented to the user telling them of the problem and the submittal is aborted. If no record exists with the key then the submittal goes through. Is this kind of behavior possible using Survey123 and the hosted feature service?

In this post, I see how the surveys are moved to the Sent box when they are successfully submitted but that is not quite what we are looking for. Survey 123 Data in Sent folder not received in database

Thanks,

Bill

6 Replies
Shwu-jingJeng
Esri Regular Contributor

Hi Bill,

We have a beta feature which might be closed to what you are requesting for.

Please check this document on our early adopter website:

https://earlyadopter.esri.com/project/article/item.html?cap=e69ef91f45744b98882c651f7b518eb7&arttype...

Survey pulldata() properties: mode & status

You could use the pulldata() properties to identify the status of the survey, that way, if a survey is being submitted, the status will show Sent.

BillMacPherson
Regular Contributor

Shwu-jing Jeng,

Thank you for your quick response and letting me know about the new Mode and Status properties. I may use them in the future. It looks like adding a unique constraint on a field in the feature layer will work for our workflow. This provides a clean error result in the Outbox when the user tries to submit a survey with a duplicate value for the unique constraint field.

Add a unique constraint to a field

Thanks,

Bill

khutchinson
Emerging Contributor

Hi there, I am using this option to prevent duplicate values being entered in my survey. However, I would really like the ability to let the submitter know why the survey was rejected. Anyone who may see this know of a way to customize the error message so it's not gibberish to a non-GIS user? 

JonahW
by
Regular Contributor

Hello @khutchinson,

I was curious if you were able to figure out how to generate a custom message.

Thank you!

Alina 

wwwl_singlis
New Contributor

Has anyone had any luck with this? This is the exact issue I am working on at the moment. Customised error message. It's not a show-stopper, but it is ugly having this gibberish message appear.

Sara_
by
Occasional Contributor

Hi, 

Has anyone had any success with this concept in Field Maps? 

I need to limit duplicate input QR codes when samplers are submitting from the field. 

Thanks 

0 Kudos