Select to view content in your preferred language

Attribute Rules: Populate Value Based on Other Table (Addressing)

198
3
Jump to solution
11-15-2024 11:10 AM
mlguanes
Occasional Contributor

I've been tasked with migrating from ArcMap's Attribute Assistant set up to ArcGIS Pro's Attribute Rules for our Address Management. In Attribute Assistant, we used COPY_LINKED_RECORD to populate the different parts of the address (e.g. RoadPreDirection, RoadName, RoadType, RoadPostDirection) once the user entered the FullRoadName. 

I have a table MasterStreetNames that includes all that information so I'm trying to code that relationship so it pulls the needed value. This is what I have so far - but it's currently giving me the error of Field Not Found ?

Any guidance is appreciated!!

var lookupField = "RoadPreDirection"
var commonField = "FullRoadName"
var sourceTable = FeatureSetByName($datastore, "MasterStreetName", [commonField, lookupField], false)

var commonValue = $feature[commonField]
var matchedFeatures = Filter(sourceTable, `${commonField} = @commonValue`)
var matchedFeature = First(matchedFeatures)
return Iif(matchedFeature == null, null, matchedFeature[lookupField])

 

0 Kudos
1 Solution

Accepted Solutions
mlguanes
Occasional Contributor

Solved it! 
For anyone in a similar situation, the following worked (replacing "RoadName" for whatever field is needed: 

var sourceTable = FeatureSetByName($datastore,"MasterStreetName", ["FullRoadName", "RoadName"], false)
var matchingAttr = $feature.FullRoadName
var matchedFeature = First(Filter(sourceTable, "FullRoadName = @matchingAttr"))
If (matchedFeature == null){
    return null}
else{
    return matchedFeature.RoadName}

 

View solution in original post

0 Kudos
3 Replies
mlguanes
Occasional Contributor

Solved it! 
For anyone in a similar situation, the following worked (replacing "RoadName" for whatever field is needed: 

var sourceTable = FeatureSetByName($datastore,"MasterStreetName", ["FullRoadName", "RoadName"], false)
var matchingAttr = $feature.FullRoadName
var matchedFeature = First(Filter(sourceTable, "FullRoadName = @matchingAttr"))
If (matchedFeature == null){
    return null}
else{
    return matchedFeature.RoadName}

 

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

In case you need it, take a look at the address solution, it includes attribute rules

 

https://arcg.is/PuTWX0

0 Kudos
mlguanes
Occasional Contributor

Yes I'm proposing this solution to my GIS manager 😊 Thanks!

0 Kudos