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.
<SPAN class="comment token">// Value to copy from the intersected feature</SPAN>
var intersecting_field <SPAN class="operator token">=</SPAN> <SPAN class="string token">"TLNO GIS"</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">//Field rule is assigned to in the Attribute Rule</SPAN>
var feature_field <SPAN class="operator token">=</SPAN> <SPAN class="string token">"TLNO"</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// Create feature set to the intersecting class using the GDB Name</SPAN>
var intersecting_featset <SPAN class="operator token">=</SPAN> <SPAN class="token function">FeatureSetByName</SPAN><SPAN class="punctuation token">(</SPAN>$datastore<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"WC Tax Lots"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">[</SPAN>intersecting_field<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="token boolean">true</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// Intersect the edited feature with the feature set and retrieve the first feature</SPAN>
var intersected_feature <SPAN class="operator token">=</SPAN> <SPAN class="token function">First</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="token function">Intersects</SPAN><SPAN class="punctuation token">(</SPAN>intersecting_featset<SPAN class="punctuation token">,</SPAN> $feature<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// Check to make sure there was an intersected feature, if not, return the original value</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>intersected_feature <SPAN class="operator token">==</SPAN> null<SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">return</SPAN> $feature<SPAN class="punctuation token">[</SPAN>feature_field<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="comment token">// If the intersected feature is null, return the original value</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="token function">IsEmpty</SPAN><SPAN class="punctuation token">(</SPAN>intersected_feature<SPAN class="punctuation token">.</SPAN>valueToCopy<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">return</SPAN> $feature<SPAN class="punctuation token">[</SPAN>feature_field<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="comment token">// Return the intersected features value</SPAN>
<SPAN class="keyword token">return</SPAN> intersected_feature<SPAN class="punctuation token">[</SPAN>intersecting_field<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>