AnsweredAssumed Answered

Calculate field based on common geometry using Attribute Rules

Question asked by brianmcleer on Aug 28, 2019
Latest reply on Aug 29, 2019 by xander_bakker

Being new to Arcade and Attribute rules, I am trying to put in place a rule that populates a tax lot ID number on an address point upon insert or update. The error I receive comes from line 6 at the bottom of the thread.


             ERROR 002717: Invalid Arcade expression, Arcade error: Table not found WC Tax Lots


What I am having trouble connecting the dots is how to grab the TLNO from the tax lot polygon and assign it to the TLNO GIS field in the address point feature class. In my Contents, the tax lot layer is titled as WC Tax Lots as it is in the code below.


I received the code sample from GitHub - Esri/arcade-expressions: ArcGIS Arcade expression templates for all supported profiles in the ArcGIS platform. 


// Value to copy from the intersected feature
var intersecting_field = "TLNO GIS";
//Field rule is assigned to in the Attribute Rule
var feature_field = "TLNO";
// Create feature set to the intersecting class using the GDB Name
var intersecting_featset = FeatureSetByName($datastore, "WC Tax Lots", [intersecting_field], true);
// Intersect the edited feature with the feature set and retrieve the first feature
var intersected_feature = First(Intersects(intersecting_featset, $feature));
// Check to make sure there was an intersected feature, if not, return the original value
if (intersected_feature == null)
return $feature[feature_field];
// If the intersected feature is null, return the original value
if (IsEmpty(intersected_feature.valueToCopy))
return $feature[feature_field];
// Return the intersected features value
return intersected_feature[intersecting_field];