I am setting up some attribute rules to populate fields in my NG911 address database. A Lot of these fields are populated off of interests of 3 different polygon layers. I have them all set up as multiple rules now and they are working, but editing is very slow.
I know I can combine these rules into one, just not sure how to do it when I am intersecting multiple layers to populate different fields.
Can some one point me in the right direction or have a sample for me?
Thanks,
Justin
Solved! Go to Solution.
Basically, instead of choosing a field for the Attribute Rule and returning a value, you leave the field empty and return a dictionary. The possible keys of this dictionary are described here: https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/attribute-rule-dictionary-k...
var attribute_1 = null
var attribute_2 = null
var attribute_3 = "Nothing here"
var layer_1 = FeatureSetByName($datastore, "FC_1")
var id = $feature.SomeID
var polygon_1 = First(Filter(layer_1, "SomeID = @ID"))
if(polygon_1 != null) { attribute_1 = polygon_1.Attribute }
var layer_2 = FeatureSetByRelationshipName($feature, "Relationship")
var polygon_2 = First(layer_2)
if(polygon_2 != null) { attribute_2 = polygon_2.Attribute }
var layer_3 = FeatureSetByName($datastore, "FC_3")
var polygon_3 = First(Intersects($feature, layer_3))
if(polygon_3 != null) { attribute_3 = polygon_3.Attribute }
return {
result: {
attributes: {
Attribute1: attribute_1,
Attribute2: attribute_2,
Attribute3: attribute_3,
}
}
}
Basically, instead of choosing a field for the Attribute Rule and returning a value, you leave the field empty and return a dictionary. The possible keys of this dictionary are described here: https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/attribute-rule-dictionary-k...
var attribute_1 = null
var attribute_2 = null
var attribute_3 = "Nothing here"
var layer_1 = FeatureSetByName($datastore, "FC_1")
var id = $feature.SomeID
var polygon_1 = First(Filter(layer_1, "SomeID = @ID"))
if(polygon_1 != null) { attribute_1 = polygon_1.Attribute }
var layer_2 = FeatureSetByRelationshipName($feature, "Relationship")
var polygon_2 = First(layer_2)
if(polygon_2 != null) { attribute_2 = polygon_2.Attribute }
var layer_3 = FeatureSetByName($datastore, "FC_3")
var polygon_3 = First(Intersects($feature, layer_3))
if(polygon_3 != null) { attribute_3 = polygon_3.Attribute }
return {
result: {
attributes: {
Attribute1: attribute_1,
Attribute2: attribute_2,
Attribute3: attribute_3,
}
}
}
Also, a lot of the slowness of Attribute Rules comes from the loading of FeatureSets. To make it quicker:
Thank you for these solutions. They have helped the performance.