Hello,
We're using Field Maps and QuickCapture mobile apps to add inspection point locations in the field to hosted feature layer. is there a way to get a notification or ideally prevent duplicate IDs from being manually entered? For instance, field tech goes out and enters new inspection point as WATER123. Then, a few days later and a couple streets over, tech goes back out and tries to enter another new inspection point as WATER123 but the app displays error message or something similar that won’t allow duplicate ID.
In Field Maps you can use arcade expressions to display a warning message when IDs are duplicated within a featureset of inspection points. An example might look like this:
var fsInspections = FeatureSetByName($map, "Inspection Points", ['InspectionID'], false);
var thisID = $feature.InspectionID
if(Count(Filter((fsInspections), 'InspectionID LIKE @thisID')) > 1){
return 'Duplicate ID Warning'
}
Prevention is a little harder, especially without knowing more details. Are the field techs working in a disconected environment? Does it need to be a hosted feature layer? If Enterprise is an option, you might use a validation attribute rule on the geodatabase. If not, Survey123 smart forms offer more control over user entry than Field Maps or Quick Capture, and you can pass the results of expressions like the one above into the inspection form.
Are you applying this arcade expression as a Editable Expression? When I attempt to apply the same code block (configured to align with my FeatureSet, the field does not appear to be editable. Applying the code to as a Calculated Expression restricts editing capabilities as well.