<?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: Using Attribute Rules With Joined Tables To Pass Attribute Based On Intersecting Feature in Attribute Rules Videos</title>
    <link>https://community.esri.com/t5/attribute-rules-videos/using-attribute-rules-with-joined-tables-to-pass/m-p/1009370#M13</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/27483"&gt;@SterlingLoetz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It won't be possible to access joined fields using attribute rules.&amp;nbsp; Joins exist only in the "current session" - this one particular Pro project - whereas attribute rules are stored in the geodatabase so that they can be executed from anywhere the data is accessed.&lt;/P&gt;&lt;P&gt;That being said, I can think of two ways to make this work.&amp;nbsp; First, you could instead build a Relationship Class in the database.&amp;nbsp; Then, you could use FeatureSetByRelationshipName to get the related features and query their attributes.&lt;/P&gt;&lt;P&gt;Another solution would be to build some logic using the key fields that allowed you to create the join.&amp;nbsp; In the code sample below I called these fields PrimaryKey (polygon) and ForiegnKey (table).&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var ParcelLayer = FeatureSetByName($datastore, "ParcelLayer", ["PrimaryKey"]);
var Intr = Intersects(ParcelLayer, Geometry($feature));
var cnt = Count(Intr)
if (cnt == 0) {
  return null
} else {
  // get the primary key from the intersecting polygon
  var feat = First(Intr)
  var pkey = feat.PrimaryKey
  // get the standalone table
  var tbl = FeatureSetByName($datastore, "parcelview_copy", ["ADCO_Pin", "ForeignKey"]);
  // iterate through the table to find the record with a matching key value;
  // return the pin from the matching record
  for (var t in tbl){
    if (t.ForeignKey == pkey){
      return t.ADCO_Pin
    }
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Dec 2020 17:57:56 GMT</pubDate>
    <dc:creator>CooperLogan_esri</dc:creator>
    <dc:date>2020-12-14T17:57:56Z</dc:date>
    <item>
      <title>Using Attribute Rules With Joined Tables To Pass Attribute Based On Intersecting Feature</title>
      <link>https://community.esri.com/t5/attribute-rules-videos/using-attribute-rules-with-joined-tables-to-pass/m-p/1008944#M12</link>
      <description>&lt;P&gt;I have a question about using Attribute Rules (AR) to trigger an attribute calculation based on an intersecting polygon feature that has a joined table within ArcGIS Pro. Is there a way to use AR with joined tables? I know this can work with related records, however my question pertains specifically to joined tables in Pro. I must preface this post by saying I am very much a beginner with Arcade &amp;amp; AR.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Success Thus Far:&lt;/STRONG&gt;&amp;nbsp;I am working with a point layer and a parcel layer. When a point feature is created inside a polygon parcel, the parcel number is passed from the parcel polygon layer to a parcel number field in the point feature class. This works great and below is my successful Arcade expression for the AR.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Working Expression.PNG" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/1993iA96BDC6C9E19B2D4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Working Expression.PNG" alt="Working Expression.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Current Challenge:&amp;nbsp;&lt;/STRONG&gt;I have a standalone table residing in the same geodatabase that house the point and parcel feature classes. The table is called "parcelview_copy". This table contains additional information about parcels and I have joined this table to the parcel polygon feature class within Pro. I want to pass a different PIN field, "ADCO_PIN" to the point feature class when a point is created within a parcel. I get this error in the Arcade expression below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Error Expression.PNG" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/1994i3E58C7A9BB040DE1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Error Expression.PNG" alt="Error Expression.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'm not really sure what I'm doing wrong or if joined tables are supported by AR?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2020 17:47:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-videos/using-attribute-rules-with-joined-tables-to-pass/m-p/1008944#M12</guid>
      <dc:creator>SterlingLoetz</dc:creator>
      <dc:date>2020-12-11T17:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using Attribute Rules With Joined Tables To Pass Attribute Based On Intersecting Feature</title>
      <link>https://community.esri.com/t5/attribute-rules-videos/using-attribute-rules-with-joined-tables-to-pass/m-p/1009370#M13</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/27483"&gt;@SterlingLoetz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It won't be possible to access joined fields using attribute rules.&amp;nbsp; Joins exist only in the "current session" - this one particular Pro project - whereas attribute rules are stored in the geodatabase so that they can be executed from anywhere the data is accessed.&lt;/P&gt;&lt;P&gt;That being said, I can think of two ways to make this work.&amp;nbsp; First, you could instead build a Relationship Class in the database.&amp;nbsp; Then, you could use FeatureSetByRelationshipName to get the related features and query their attributes.&lt;/P&gt;&lt;P&gt;Another solution would be to build some logic using the key fields that allowed you to create the join.&amp;nbsp; In the code sample below I called these fields PrimaryKey (polygon) and ForiegnKey (table).&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var ParcelLayer = FeatureSetByName($datastore, "ParcelLayer", ["PrimaryKey"]);
var Intr = Intersects(ParcelLayer, Geometry($feature));
var cnt = Count(Intr)
if (cnt == 0) {
  return null
} else {
  // get the primary key from the intersecting polygon
  var feat = First(Intr)
  var pkey = feat.PrimaryKey
  // get the standalone table
  var tbl = FeatureSetByName($datastore, "parcelview_copy", ["ADCO_Pin", "ForeignKey"]);
  // iterate through the table to find the record with a matching key value;
  // return the pin from the matching record
  for (var t in tbl){
    if (t.ForeignKey == pkey){
      return t.ADCO_Pin
    }
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 17:57:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-videos/using-attribute-rules-with-joined-tables-to-pass/m-p/1009370#M13</guid>
      <dc:creator>CooperLogan_esri</dc:creator>
      <dc:date>2020-12-14T17:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using Attribute Rules With Joined Tables To Pass Attribute Based On Intersecting Feature</title>
      <link>https://community.esri.com/t5/attribute-rules-videos/using-attribute-rules-with-joined-tables-to-pass/m-p/1030257#M20</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/426753"&gt;@CooperLogan_esri&lt;/a&gt;&amp;nbsp;this solution works great, thank you for your response and help. I have another question that I was wondering if you may some insight into. Using the above expression works for creating new points that obtain attribute information from the polygon join table. However the problem I am seeing is when I create a point in a polygon that has an existing PIN that matches a record in the joined table, there is a problem if the associated ADCO_PIN is Null. The problem occurs when updating the location of the point to a different parcel polygon.&lt;/P&gt;&lt;P&gt;For example, when I create a point within a polygon that has a joined table ADCO_PIN value of 012345 the ADCO_PIN will carry over to the point attribute just fine. However if I move this point to a parcel that has a joined table record, but the value is null, the ADCO_PIN in the point feature class will not update to null as seen in new parcel. It will still show the PIN 012345 of the previous parcel polygon. I worked with the expression a little but could not find a solution. Thanks for any insight.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 22:37:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-videos/using-attribute-rules-with-joined-tables-to-pass/m-p/1030257#M20</guid>
      <dc:creator>SterlingLoetz</dc:creator>
      <dc:date>2021-02-24T22:37:33Z</dc:date>
    </item>
  </channel>
</rss>

