HOW TO
When creating features for a new feature layer, it is uncommon to refer to an existing table or an attribute table of a feature layer to populate the value of the matching field of both the table and the feature layer. When creating a big number of features, repopulating the field with the existing table may take time, or an extra steps by running the calculation. It is possible to automatically populate the data as the feature is created by using attribute rule. This article describes how to do so.
var sourceTable = FeatureSetByName($datastore,"<Feature_Name>", ["<Matching_Field>", "<Output_Field>"], false) var matchedFeature = First(Filter(sourceTable, "<Matching_Field> = $feature.<Matching_Field")) If (matchedFeature == null){ return "not found"} else{ return matchedFeature.<Output_Field>}
var sourceTable = FeatureSetByName($datastore,"House", ["OBJECTID", "Direction"], false) var matchedFeature = First(Filter(sourceTable, "OBJECTID = $feature.OBJECTID")) If (matchedFeature == null){ return "not found"} else{ return matchedFeature.matchedFeature.Direction}
Article ID:000030999
Get help from ArcGIS experts
Download the Esri Support App