Select to view content in your preferred language

How to prevent duplicate records before submission

208
2
03-24-2025 04:55 PM
ChrisJRoss13
Occasional Contributor

I'm working on a Survey123 form and trying to configure it to prevent duplicate submissions based on the Business Name field. Ideally, I’d like the form to check whether a business name has already been submitted and, if so, display a message or prevent the user from proceeding.

I’ve come across a few references to using JavaScript functions in Survey123 for this type of validation, but I haven’t found a complete working example that fits my use case.

Here’s what I’m trying to do:

  • User enters a Business Name in a text field.

  • Before submitting, the form checks if that name already exists in feature layer.

  • If it does, the form:

    • shows an error message

0 Kudos
2 Replies
JakeMatthys
Frequent Contributor

Following this topic.  My organization also has use case to prevent duplicate submissions based on a key value.

0 Kudos
TylerGraham2
Frequent Contributor

I would look at putting a pulldata("@layer") function in the constraint field for Business name that queries the layer for the value someone is entering.  Here's a link to how pulldata("@layer") works and how to set it up. It would be simpler than writing JavaScript. The 2nd link does say that pulldata works in the constraint column.  

https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-pulldata-quot-laye...

https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm

0 Kudos