<?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: Attribute Rule Updating Two Intersecting Polygons in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1566308#M91031</link>
    <description>&lt;P&gt;EDIT - don't pay attention to this, neither of these will work, scroll down to my second reply, which is much better.&lt;/P&gt;&lt;P&gt;For starters, it looks like your variable names didn't get updated when you reworked it into your own data, so that's important. Additionally, in your return, you'd need to replace&amp;nbsp; &amp;lt;Field Name From Layer 2&amp;gt; with the actual name of the field you want to update.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are a couple of rules that I think get you what you want. The first one is on the buildings and will apply the parent status when the building is created. The second will push the parent status to all intersecting buildings when the parent is updated. I am a little unsure if I did the loop correctly, so if anyone else following along here sees an issue, please feel free to update it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// RULE RUNS ON INSERT
// APPLY RULE TO BUILDING FEATURE CLASS

// Get Parent shapes
var Parent = FeatureSetByName($datastore,"Parent",["Status"],false);

// Find intersecting parent
var intParent = intersects($feature, Parent)

// Find first parent
var fPar = First(intParent)

//
return {
  'result':{
  'attributes':{
   'Status':fPar.Status
}




// RULE RUNS ON UPDATE
// APPLY RULE TO PARENT FEATURE CLASS

// Get Buildings shapes
var Buildings = FeatureSetByName($datastore,"Parent",["Status"],false);

// Find all intersecting buildings
var intBuilds = intersects($feature,Buildings)

var bStatus = intBuilds.Status

// Loop through all buildings. This will push the status from the Parent feature to all buiuldings features that touch it
for (var s in intBuild){
  bStatus = $feature.Status
}

return {
    edit: [{
        className: "Buildings",
        updates: [{
            objectID: Buildings.OBJECTID,
            attributes: {
                Status: bStatus,
           }
        }]
    }]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Dec 2024 17:14:14 GMT</pubDate>
    <dc:creator>ZachBodenner</dc:creator>
    <dc:date>2024-12-09T17:14:14Z</dc:date>
    <item>
      <title>Attribute Rule Updating Two Intersecting Polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1565608#M90938</link>
      <description>&lt;P&gt;I am trying to create an attribute rule that when I update a field in one polygon, the intersecting polygon's field will also update.&amp;nbsp; Is there an an arcade expression I should try?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 14:49:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1565608#M90938</guid>
      <dc:creator>PaulMAlexander</dc:creator>
      <dc:date>2024-12-06T14:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule Updating Two Intersecting Polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1565644#M90944</link>
      <description>&lt;P&gt;Here's a rule I have in my production environment. It runs on a point feature class but that's not a requirement, can be a polygon also. This will essentially check if a newly places point intersects three different layers, and write an attribute from each of those layers to the newly created point if there is an intersect. So this runs on an insert, but you could set it to update instead.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// Make layers available
var cityParcels = FeatureSetByName($datastore, "epgdb.GIS.Parcels",['PID','Address'],false);
var parks = FeatureSetByName($datastore, "epgdb.PARKS.Parks",['PARKNAME'],false);
var owner = FeatureSetByName($datastore, "epgdb.parks.TreeOwnership_vw",['Ownership'],false);

// Find intersection feature
var fAdd = First(Intersects($Feature, cityParcels));
var fPrk = First(Intersects($Feature, parks));
var fOwn = First(Intersects($Feature, owner));

// Variables - check for nulls. If the feature does not intersect a feature on the polygon layer, return null
var addr = IIF(!IsEmpty(fAdd),proper(fAdd.Address),null)
var prk = IIF(!IsEmpty(fPrk),proper(fPrk.PARKNAME),null)
var own = IIF(!IsEmpty(fOwn),proper(fOwn.Ownership),null)

// Use a dictionary to write the values of the null-check variables
return{
 'result':{
  'attributes':{
   'Address':addr,
   'Park':prk,
   'Location':own,
  }
 }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 16:00:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1565644#M90944</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2024-12-06T16:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule Updating Two Intersecting Polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1565735#M90957</link>
      <description>&lt;P&gt;Okay so for example, I am placing a polygon with a specific field. I am then placing another polygon inside of it and currently it copies that field to the new feature. Will this allow me to add a rule that when I change that field in the first polygon, it will auto update that field in the second polygon?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 18:00:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1565735#M90957</guid>
      <dc:creator>PaulMAlexander</dc:creator>
      <dc:date>2024-12-06T18:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule Updating Two Intersecting Polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1565776#M90963</link>
      <description>&lt;P&gt;Are the two different polygons on two layers, or are they in the same dataset?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 19:04:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1565776#M90963</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2024-12-06T19:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule Updating Two Intersecting Polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1565779#M90964</link>
      <description>&lt;P&gt;They are currently two different layers.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 19:12:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1565779#M90964</guid>
      <dc:creator>PaulMAlexander</dc:creator>
      <dc:date>2024-12-06T19:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule Updating Two Intersecting Polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1565782#M90965</link>
      <description>&lt;P&gt;Great, that does make it a bit easier. So this will basically pushes the changes from the feature where the edit occurs to the second feature class that you've identified as a variable and found a match. Pretty much just changing the structure of the dictionary:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;return {
    edit: [{
        className: "Feature.Class.Name",
        updates: [{
            objectID: asset.OBJECTID,
            attributes: {
                &amp;lt;Field Name From Layer 2&amp;gt;: $feature.FieldName,
                &amp;lt;Field Name From Layer 2&amp;gt;: $feature.FieldName
		// add additional attributes as necessary
            }
        }]
    }]
}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 06 Dec 2024 19:27:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1565782#M90965</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2024-12-06T19:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule Updating Two Intersecting Polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1566284#M91027</link>
      <description>&lt;P&gt;So for example, Parent is my source polygon. I am drawing Building inside of it and it is copying the status field of Parent. When I change the Parent status, it also changes Building. This is my current expression, but it throws an invalid Key message on line 15,&amp;nbsp;&amp;lt;Field Name From Layer 2&amp;gt;: $feature.Status.&amp;nbsp; Am I missing somthing? I removed the null section because the value in the field would never be null.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PaulMAlexander_1-1733761041100.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/121160iAABB8BE5FD7D5190/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PaulMAlexander_1-1733761041100.png" alt="PaulMAlexander_1-1733761041100.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 16:18:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1566284#M91027</guid>
      <dc:creator>PaulMAlexander</dc:creator>
      <dc:date>2024-12-09T16:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule Updating Two Intersecting Polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1566308#M91031</link>
      <description>&lt;P&gt;EDIT - don't pay attention to this, neither of these will work, scroll down to my second reply, which is much better.&lt;/P&gt;&lt;P&gt;For starters, it looks like your variable names didn't get updated when you reworked it into your own data, so that's important. Additionally, in your return, you'd need to replace&amp;nbsp; &amp;lt;Field Name From Layer 2&amp;gt; with the actual name of the field you want to update.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are a couple of rules that I think get you what you want. The first one is on the buildings and will apply the parent status when the building is created. The second will push the parent status to all intersecting buildings when the parent is updated. I am a little unsure if I did the loop correctly, so if anyone else following along here sees an issue, please feel free to update it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// RULE RUNS ON INSERT
// APPLY RULE TO BUILDING FEATURE CLASS

// Get Parent shapes
var Parent = FeatureSetByName($datastore,"Parent",["Status"],false);

// Find intersecting parent
var intParent = intersects($feature, Parent)

// Find first parent
var fPar = First(intParent)

//
return {
  'result':{
  'attributes':{
   'Status':fPar.Status
}




// RULE RUNS ON UPDATE
// APPLY RULE TO PARENT FEATURE CLASS

// Get Buildings shapes
var Buildings = FeatureSetByName($datastore,"Parent",["Status"],false);

// Find all intersecting buildings
var intBuilds = intersects($feature,Buildings)

var bStatus = intBuilds.Status

// Loop through all buildings. This will push the status from the Parent feature to all buiuldings features that touch it
for (var s in intBuild){
  bStatus = $feature.Status
}

return {
    edit: [{
        className: "Buildings",
        updates: [{
            objectID: Buildings.OBJECTID,
            attributes: {
                Status: bStatus,
           }
        }]
    }]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 17:14:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1566308#M91031</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2024-12-09T17:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule Updating Two Intersecting Polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1566320#M91032</link>
      <description>&lt;P&gt;Actually, scratch all of this, I thought too hard about it all.&lt;/P&gt;&lt;P&gt;Okay, first rule&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// Get Parent shapes
var Parent = FeatureSetByName($datastore,"Parent",["Status"],false);

// Find intersecting parent
var intParent = intersects($feature, Parent)

// Find first parent
var fPar = First(intParent)


return iif(!isEmpty(fpar),fPar.Status,'')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZachBodenner_0-1733764333408.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/121169i4106C756CA708CBB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZachBodenner_0-1733764333408.png" alt="ZachBodenner_0-1733764333408.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just make sure you call out the attribute in the rule and it become easier.&lt;/P&gt;&lt;P&gt;Second rule (apply this one to the parent layer) - this is one I actually put together for a different project and had forgotten about until now:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// Get Buildings shapes
var Buildings = FeatureSetByName($datastore,"Parent",["Status"],false);

// Find all intersecting buildings
var intBuilds = intersects($feature,Buildings)
var stat = ''
// Loop through all buildings. This will push the status from the Parent feature to all buiuldings features that touch it
var pUpdates = []
for (var s in intBuilds){
  var update = {
       objectID:s.OBJECTID,
       attributes: {Status:$feature.Status}
}
Push (pUpdates,update)
}

return {
    edit: [{
       className: "Buildings",
       updates: pUpdates
    }]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZachBodenner_1-1733764381412.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/121170i123E0399E1A460D8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZachBodenner_1-1733764381412.png" alt="ZachBodenner_1-1733764381412.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just duplicated this in my environment and the rules worked, so reply back with what you find!&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 17:14:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1566320#M91032</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2024-12-09T17:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule Updating Two Intersecting Polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1567206#M91133</link>
      <description>&lt;P&gt;Great! this helped. Had to make a minor adjustment on my end, but it worked and did what I needed it to do. Appreciate the assistance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 12:06:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1567206#M91133</guid>
      <dc:creator>PaulMAlexander</dc:creator>
      <dc:date>2024-12-11T12:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule Updating Two Intersecting Polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1567230#M91134</link>
      <description>&lt;P&gt;Now how difficult would it be to change the expression if I am wanting it update multiple layers when changing the parent status and not just the building layer?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 13:27:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1567230#M91134</guid>
      <dc:creator>PaulMAlexander</dc:creator>
      <dc:date>2024-12-11T13:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule Updating Two Intersecting Polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1567239#M91136</link>
      <description>&lt;P&gt;Since that push targets a specific layer, what I would do is just create another rule, copy-paste the rule text, and then make the necessary adjustments (layer name, attributes changed, etc).&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 13:40:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1567239#M91136</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2024-12-11T13:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule Updating Two Intersecting Polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1567338#M91150</link>
      <description>&lt;P&gt;Great that really helped. Have you ever gotten an error messaged after implementing the rule that says "index passed was not within the valid range." ?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 17:04:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1567338#M91150</guid>
      <dc:creator>PaulMAlexander</dc:creator>
      <dc:date>2024-12-11T17:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule Updating Two Intersecting Polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1567349#M91153</link>
      <description>&lt;P&gt;I haven't myself, but perhaps this thread can help you:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/mapping-questions/the-index-passed/td-p/557777" target="_blank"&gt;https://community.esri.com/t5/mapping-questions/the-index-passed/td-p/557777&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 17:26:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-updating-two-intersecting-polygons/m-p/1567349#M91153</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2024-12-11T17:26:16Z</dc:date>
    </item>
  </channel>
</rss>

