General: I have a feature class with a related table. I want a field in the feature class to be updated to include data from the related table when the corresponding field in the related table is updated.
Specifics. I have a feature class of ROW acquisition parcels (ROWAcqParcels) and a related table (ROWAcqParcelsTable) that houses all of the relevant acquisition information for the parcels. The key for the relate is the Parcel ID Number (not sure that's relevant). When the ROW agent fills out the TITLE_WORK_RECEIVED field in the related table, I want that information to be copied to the TITLE_WORK_RECEIVED field in the feature class.
What I currently have is shown below. The code verifies as valid when I build the expression but when I attempt to save the rule, I get an error that says there's an unexpected null, Script line:7
I've looked at a number of different posts and forums related to this and I've tried a number of the solutions but I'm not having any luck.
var sourceTable = FeatureSetByName($datastore, "ROWAcqParcelsTable", ["*"], false)
var key = $feature.PIN
var selectFeature = First(Filter(sourceTable, "PIN = "))
var titleFeature = selectFeature.TITLE_WORK_RECEIVED
if (!IsEmpty(titleFeature)){
return "Yes"
}
Thanks!!
Solved! Go to Solution.
Thank you for the help! I was actually able to find something that worked at the end of the day yesterday. I followed what was done in this post:
Hi @MelissaGearman,
A couple of things.
var sourceTable = FeatureSetByName($datastore, "ROWAcqParcelsTable", ["*"], false)
var key = $feature.PIN
var selectFeature = First( Filter( sourceTable , "PIN = @key") )
iif( !IsEmpty( selectFeature ) && selectFeature.PIN == key , "YES" , "NO" )
You could try the Update Related AR template found in here - https://github.com/Esri/arcade-expressions/tree/master/attribute-rules/attribute_assistant
https://esri.github.io/arcade-expressions/docs/3.3/UpdateRelated.html
This will be a core Templated Attribute Rule in 3.5
Thank you for the help! I was actually able to find something that worked at the end of the day yesterday. I followed what was done in this post: