<?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 Using Attribute Rules to Insert Values from one Polygon field to another in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/using-attribute-rules-to-insert-values-from-one/m-p/1169757#M54653</link>
    <description>&lt;P&gt;I am playing around a trying to create an attribute rule, I have two polygon layers, a test parcel layer and a subdivision layer.&amp;nbsp; When I create a parcel I want the subdivision name to copy over.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;// This rule will populate the edited features field with a value from an intersecting feature

// Value to copy from the intersected feature
var intersecting_field = "Name";

// Create feature set to the intersecting class using the GDB Name
var intersecting_featset = FeatureSetByName($datastore, 'Subdivisions', [intersecting_field], true);

// Intersect the edited feature with the feature set and retrieve the first feature
var intersected_feature = First(Within(intersecting_featset, $feature));

// Check to make sure there was an intersected feature, if not, return the original value
if (IsEmpty(intersected_feature) || intersected_feature == null)
{ 
    return;
}
// If the intersected feature is null, return the original value
if (IsEmpty(intersected_feature.Name))
{
    return;
}
return {
    //result is a dictionary
    "result": {
        "attributes": {
            "ValueCopied": intersected_feature[intersecting_field]
        }
    }
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this is the code I was using however whenever I placed a parcel inside of the subdivision polygons I got this error message (Attached).&lt;/P&gt;</description>
    <pubDate>Mon, 02 May 2022 16:12:49 GMT</pubDate>
    <dc:creator>phess_luckstone</dc:creator>
    <dc:date>2022-05-02T16:12:49Z</dc:date>
    <item>
      <title>Using Attribute Rules to Insert Values from one Polygon field to another</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/using-attribute-rules-to-insert-values-from-one/m-p/1169757#M54653</link>
      <description>&lt;P&gt;I am playing around a trying to create an attribute rule, I have two polygon layers, a test parcel layer and a subdivision layer.&amp;nbsp; When I create a parcel I want the subdivision name to copy over.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;// This rule will populate the edited features field with a value from an intersecting feature

// Value to copy from the intersected feature
var intersecting_field = "Name";

// Create feature set to the intersecting class using the GDB Name
var intersecting_featset = FeatureSetByName($datastore, 'Subdivisions', [intersecting_field], true);

// Intersect the edited feature with the feature set and retrieve the first feature
var intersected_feature = First(Within(intersecting_featset, $feature));

// Check to make sure there was an intersected feature, if not, return the original value
if (IsEmpty(intersected_feature) || intersected_feature == null)
{ 
    return;
}
// If the intersected feature is null, return the original value
if (IsEmpty(intersected_feature.Name))
{
    return;
}
return {
    //result is a dictionary
    "result": {
        "attributes": {
            "ValueCopied": intersected_feature[intersecting_field]
        }
    }
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this is the code I was using however whenever I placed a parcel inside of the subdivision polygons I got this error message (Attached).&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 16:12:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/using-attribute-rules-to-insert-values-from-one/m-p/1169757#M54653</guid>
      <dc:creator>phess_luckstone</dc:creator>
      <dc:date>2022-05-02T16:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using Attribute Rules to Insert Values from one Polygon field to another</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/using-attribute-rules-to-insert-values-from-one/m-p/1170034#M54682</link>
      <description>&lt;P&gt;It's telling you that it can't find "valuecopied". Change line 26 to&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"Subdivision": intersected_feature[intersecting_field]&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 03 May 2022 11:15:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/using-attribute-rules-to-insert-values-from-one/m-p/1170034#M54682</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-05-03T11:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using Attribute Rules to Insert Values from one Polygon field to another</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/using-attribute-rules-to-insert-values-from-one/m-p/1170070#M54689</link>
      <description>&lt;P&gt;This was it, thank you so much, thats what I get copying straight from github.&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 12:48:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/using-attribute-rules-to-insert-values-from-one/m-p/1170070#M54689</guid>
      <dc:creator>phess_luckstone</dc:creator>
      <dc:date>2022-05-03T12:48:14Z</dc:date>
    </item>
  </channel>
</rss>

