Select to view content in your preferred language

How to prevent duplicates from being submitted in a free text field

646
2
10-17-2023 01:22 PM
jochoa6
New Contributor

Hi. I'm trying to prevent submission when a duplicate value is entered into a free text field. I tried adding a constraint to the field with the instructions here: Add a unique constraint to a field—ArcGIS Online Help | Documentation

But I don't have the edit button on the unique field. Help please!

0 Kudos
2 Replies
IsmaelChivite
Esri Notable Contributor

Hi. pulldata("@layer") may work for you.

Here is some background info: https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-pulldata-quot-laye... 

I attached an example below for clarity. To use the example:

  • Create a survey in Connect from the XLSForm
  • Publish the form
  • Once the form is published, replace the URL of the feature layer URL in K3 to target your own survey layer. Make sure the layer has query capabilities enabled
  • Publish again and submit

Hope it helps.

 

jochoa6
New Contributor

I'm getting the following error in the field. I'm not sure what I'm doing wrong. When I test out the survey the field that should be pulling the data is blank. 

SyntaxError: Invalid regular expression flag 'n' in expression

Here is the code: 

pulldata("@layer", "getValue", "attributes.free_text", "layerURL", concat("free_text ='",${free_text},"'"))

0 Kudos