<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calculate field based on common geometry using Attribute Rules in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-based-on-common-geometry-using/m-p/173546#M7781</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/people/brianmcleer"&gt;brianmcleer&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use the&amp;nbsp;$datastore to access a featureset, you will have to use the exact name if the featureclass in the datastore. It does not matter how you call something in the TOC.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also remember to change the "valueToCopy" on line 15 to the actual field name.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Aug 2019 19:10:07 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2019-08-28T19:10:07Z</dc:date>
    <item>
      <title>Calculate field based on common geometry using Attribute Rules</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-based-on-common-geometry-using/m-p/173545#M7780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;ERROR 002717: Invalid Arcade expression, Arcade error: Table not found WC Tax Lots&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 &lt;STRONG&gt;WC Tax Lots&lt;/STRONG&gt; as it is in the code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I received the code sample from&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Esri/arcade-expressions" title="https://github.com/Esri/arcade-expressions" rel="nofollow noopener noreferrer" target="_blank"&gt;GitHub - Esri/arcade-expressions: ArcGIS Arcade expression templates for all supported profiles in the ArcGIS platform.&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// Value to copy from the intersected feature&lt;/SPAN&gt;
var intersecting_field &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"TLNO GIS"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//Field rule is assigned to in the Attribute Rule&lt;/SPAN&gt;
var feature_field &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"TLNO"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// Create feature set to the intersecting class using the GDB Name&lt;/SPAN&gt;
var intersecting_featset &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$datastore&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"WC Tax Lots"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;intersecting_field&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// Intersect the edited feature with the feature set and retrieve the first feature&lt;/SPAN&gt;
var intersected_feature &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;First&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Intersects&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;intersecting_featset&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// Check to make sure there was an intersected feature, if not, return the original value&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;intersected_feature &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; null&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;feature_field&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// If the intersected feature is null, return the original value&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;IsEmpty&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;intersected_feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;valueToCopy&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;feature_field&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// Return the intersected features value&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; intersected_feature&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;intersecting_field&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:58:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-based-on-common-geometry-using/m-p/173545#M7780</guid>
      <dc:creator>Brian_McLeer</dc:creator>
      <dc:date>2021-12-11T08:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field based on common geometry using Attribute Rules</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-based-on-common-geometry-using/m-p/173546#M7781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/people/brianmcleer"&gt;brianmcleer&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use the&amp;nbsp;$datastore to access a featureset, you will have to use the exact name if the featureclass in the datastore. It does not matter how you call something in the TOC.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also remember to change the "valueToCopy" on line 15 to the actual field name.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2019 19:10:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-based-on-common-geometry-using/m-p/173546#M7781</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-08-28T19:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field based on common geometry using Attribute Rules</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-based-on-common-geometry-using/m-p/173547#M7782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Xander,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the exact feature class name, is that the entire connection string, or feature class name itself? Also, the tax lot feature class resides in a separate database than the address points.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2019 19:52:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-based-on-common-geometry-using/m-p/173547#M7782</guid>
      <dc:creator>Brian_McLeer</dc:creator>
      <dc:date>2019-08-28T19:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field based on common geometry using Attribute Rules</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-based-on-common-geometry-using/m-p/173548#M7783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/256610"&gt;Brian McLeer&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will probably be a problem is the data does not reside in the same datastore. It uses the datastore of the current layer/feature to search for other featureclasses by its exact name in the datastore. So it will be using the featureclass name and not the entire connection string.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2019 13:23:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-based-on-common-geometry-using/m-p/173548#M7783</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-08-29T13:23:10Z</dc:date>
    </item>
  </channel>
</rss>

