Select to view content in your preferred language

ASK FOR ARCADE STATEMENTS TO AVOID DUPLICATION OF ELECTRIC METER NUMBER IN LV SERVICE

558
2
02-22-2024 08:04 AM
RomuldKiobya
Regular Contributor

We have added field called Meter number (data type string/char) at LV Service and MV Service. we have collected data; we have handover job to client. and we want to avoid duplication when incremental data from the site will be captured. I need either someone to give arcade statement on Field map app or ArcGIS pro or Portal for ArcGIS that will disallow duplication of meter number.

2 Replies
GIS_Spellblade
Frequent Contributor

You could use some logic similar to this:

var search_duplicate = $feature.FACILITYID
var features = FEATURESETBYNAME($datastore, "Featureclass Name Here")
var sqlExpression = "A_FIELD_NAME_HERE = @search_duplicate"
var result = FILTER(features, sqlExpression)

WHEN(
  COUNT(result) > 1, `Duplicate Value, choose another ID`,
  $feature.FACILITYID
)

Or you could use a sequence:

https://support.esri.com/en-us/knowledge-base/how-to-add-auto-sequential-values-using-attribute-rule...

Also, this post has a great solution to what you're asking for:

https://community.esri.com/t5/arcgis-field-maps-questions/arcgis-fieldmaps-form-calculate-expression...

RomuldKiobya
Regular Contributor

Is working,thanks