<?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 Creating a model to do Pairwise Intersect and set an Attribute Rule in ArcGIS Enterprise Portal Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/creating-a-model-to-do-pairwise-intersect-and-set/m-p/1371269#M14488</link>
    <description>&lt;P&gt;I have 2 layers I am starting out with&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.Harvest_TEST&amp;nbsp; (this is a timber harvest unit layer)&lt;/P&gt;&lt;P&gt;2.RoadBuffer_TEST (this is a layer that contains all the road buffers)&amp;nbsp;&lt;/P&gt;&lt;P&gt;Previously, I have been manually running a Pairwise Intersect with the two and then Calculating Geometry for the "roads" field in the new intersect layer (Hrvst_Rd_Intersect_TEST) to then manually inputing the updated road area in the&amp;nbsp;Harvest_TEST layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am currently trying to do is create a model that does this for me and sets an Attribute Rule to do an Immediate Calculation which pulls the updated road areas that were calculated in the Hrvst_Rd_Intersect_TEST layer and fills it into the matching road fields in the Harvest_Test layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that I have to set Global IDs to the new Hrvst_Rd_Intersect_TEST layer after it is created in order to set an Attribute Rule.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem is that sometimes after the intersect is done, there is an uneven amount of row in the attribute table between&amp;nbsp;Harvest_TEST (6 rows) and Hrvst_Rd_Intersect_TEST (5 rows) (this occurs when there is no road along or within the harvest unit). I have been trying to run an Arcade script to do the Immediate Calculations using the code below, but I need to add a line in that tells it disregard the uneven number of rows. If that is not doable, how can I add a step in the model builder to have the Hrvst_Rd_Intersect_TEST layer have same number of rows as the Harvest_TEST layer but when no roads are present, it auto fills the field to 0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this possible or should I be using a totally different Geoprocessing tool to combine the datasets (Harvest_Test and RoadBuffer_TEST)?&lt;/P&gt;&lt;P&gt;*OBJECTID is the same in Harvest_Test layer and Hrvt_Rd_Intersect_TEST layer. I am using this as my identifier.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var sourceTable = FeatureSetByName($datastore,"Hrvst_Rd_Intersect_TEST", ["OBJECTID", "roads"], false)&lt;/P&gt;&lt;P&gt;var matchedFeature = First(Filter(sourceTable, "OBJECTID = $feature.OBJECTID"))&lt;/P&gt;&lt;P&gt;If (matchedFeature == null){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "not found"}&lt;/P&gt;&lt;P&gt;else{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return matchedFeature.matchedFeature.roads}&lt;/P&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="Model.PNG" style="width: 800px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/91887i636172AA4BDCF1B4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Model.PNG" alt="Model.PNG" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Model.PNG&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jan 2024 21:17:52 GMT</pubDate>
    <dc:creator>AndrewHiegel</dc:creator>
    <dc:date>2024-01-17T21:17:52Z</dc:date>
    <item>
      <title>Creating a model to do Pairwise Intersect and set an Attribute Rule</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/creating-a-model-to-do-pairwise-intersect-and-set/m-p/1371269#M14488</link>
      <description>&lt;P&gt;I have 2 layers I am starting out with&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.Harvest_TEST&amp;nbsp; (this is a timber harvest unit layer)&lt;/P&gt;&lt;P&gt;2.RoadBuffer_TEST (this is a layer that contains all the road buffers)&amp;nbsp;&lt;/P&gt;&lt;P&gt;Previously, I have been manually running a Pairwise Intersect with the two and then Calculating Geometry for the "roads" field in the new intersect layer (Hrvst_Rd_Intersect_TEST) to then manually inputing the updated road area in the&amp;nbsp;Harvest_TEST layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am currently trying to do is create a model that does this for me and sets an Attribute Rule to do an Immediate Calculation which pulls the updated road areas that were calculated in the Hrvst_Rd_Intersect_TEST layer and fills it into the matching road fields in the Harvest_Test layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that I have to set Global IDs to the new Hrvst_Rd_Intersect_TEST layer after it is created in order to set an Attribute Rule.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem is that sometimes after the intersect is done, there is an uneven amount of row in the attribute table between&amp;nbsp;Harvest_TEST (6 rows) and Hrvst_Rd_Intersect_TEST (5 rows) (this occurs when there is no road along or within the harvest unit). I have been trying to run an Arcade script to do the Immediate Calculations using the code below, but I need to add a line in that tells it disregard the uneven number of rows. If that is not doable, how can I add a step in the model builder to have the Hrvst_Rd_Intersect_TEST layer have same number of rows as the Harvest_TEST layer but when no roads are present, it auto fills the field to 0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this possible or should I be using a totally different Geoprocessing tool to combine the datasets (Harvest_Test and RoadBuffer_TEST)?&lt;/P&gt;&lt;P&gt;*OBJECTID is the same in Harvest_Test layer and Hrvt_Rd_Intersect_TEST layer. I am using this as my identifier.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var sourceTable = FeatureSetByName($datastore,"Hrvst_Rd_Intersect_TEST", ["OBJECTID", "roads"], false)&lt;/P&gt;&lt;P&gt;var matchedFeature = First(Filter(sourceTable, "OBJECTID = $feature.OBJECTID"))&lt;/P&gt;&lt;P&gt;If (matchedFeature == null){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "not found"}&lt;/P&gt;&lt;P&gt;else{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return matchedFeature.matchedFeature.roads}&lt;/P&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="Model.PNG" style="width: 800px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/91887i636172AA4BDCF1B4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Model.PNG" alt="Model.PNG" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Model.PNG&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 21:17:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/creating-a-model-to-do-pairwise-intersect-and-set/m-p/1371269#M14488</guid>
      <dc:creator>AndrewHiegel</dc:creator>
      <dc:date>2024-01-17T21:17:52Z</dc:date>
    </item>
  </channel>
</rss>

