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 large number of features, repopulating the field with the existing table may be time-consuming, or require an additional step to run the calculation. It is possible to automatically populate the data as the feature is created using Attribute Rules.
var sourceTable = FeatureSetByName($datastore,"<Feature_Name>", ["<Matching_Field>", "<Output_Field>"], false) var matchingAttr = $feature.<Matching_Field> var matchedFeature = First(Filter(sourceTable, "<Matching_Field> = @matchingAttr")) If (matchedFeature == null){ return "not found"} else{ return matchedFeature.<Output_Field>}
var sourceTable = FeatureSetByName($datastore,"House", ["OBJECTID", "Direction"], false) var matchingOID = $feature.OBJECTID var matchedFeature = First(Filter(sourceTable, "OBJECTID = @matchingOID")) If (matchedFeature == null){ return "not found"} else{ return matchedFeature.matchedFeature.Direction}
Article ID: 000030999
Get help from ArcGIS experts
Download the Esri Support App