<?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 to Update Feature Layer with Related Table Value in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-update-feature-layer-with/m-p/676773#M42</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Joe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use &lt;A href="https://developers.arcgis.com/arcade/function-reference/data_functions/"&gt;FeatureSetByRelationshipName &lt;/A&gt;to read related records, and you can use DML to update features from other tables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This blog might help&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.esri.com/arcgis-blog/products/arcgis-pro/data-management/advanced-gdb-attribute-rules-editing-external-features-with-attribute-rules/" title="https://www.esri.com/arcgis-blog/products/arcgis-pro/data-management/advanced-gdb-attribute-rules-editing-external-features-with-attribute-rules/"&gt;Advanced Attribute Rules – Editing features on another class with attribute rules&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Sep 2020 22:26:40 GMT</pubDate>
    <dc:creator>HusseinNasser2</dc:creator>
    <dc:date>2020-09-18T22:26:40Z</dc:date>
    <item>
      <title>Attribute Rule to Update Feature Layer with Related Table Value</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-update-feature-layer-with/m-p/676772#M41</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a number of attribute rules that populate a given field from underlying feature layers (thanks to &lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;‌).&amp;nbsp; Now I&amp;nbsp;would like to update a feature layer attribute from a related table.&amp;nbsp; In&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/arcade/guide/faq/" title="https://developers.arcgis.com/arcade/guide/faq/"&gt;Frequently Asked Questions | ArcGIS for Developers&lt;/A&gt;&amp;nbsp; the question &lt;A href="https://developers.arcgis.com/arcade/guide/types/#featureset"&gt;How do I access data from related tables&amp;nbsp;&lt;/A&gt;sends you to the Featureset page.&amp;nbsp; But I don't see anything there regarding a related table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a nutshell, I have a feature layer of City polygons that I would like to relate to a table of corresponding three letter city codes.&amp;nbsp; When I add a new feature (centerline, address point etc) I can&amp;nbsp;update the City name easily, but how would I update that City code from a related table?&amp;nbsp; I'd like to avoid adding yet another field to the City features.&amp;nbsp; Both the feature layer and related table will reside in the same $datastore, an enterprise geodatabase.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Sep 2020 18:02:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-update-feature-layer-with/m-p/676772#M41</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-09-18T18:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to Update Feature Layer with Related Table Value</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-update-feature-layer-with/m-p/676773#M42</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Joe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use &lt;A href="https://developers.arcgis.com/arcade/function-reference/data_functions/"&gt;FeatureSetByRelationshipName &lt;/A&gt;to read related records, and you can use DML to update features from other tables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This blog might help&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.esri.com/arcgis-blog/products/arcgis-pro/data-management/advanced-gdb-attribute-rules-editing-external-features-with-attribute-rules/" title="https://www.esri.com/arcgis-blog/products/arcgis-pro/data-management/advanced-gdb-attribute-rules-editing-external-features-with-attribute-rules/"&gt;Advanced Attribute Rules – Editing features on another class with attribute rules&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Sep 2020 22:26:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-update-feature-layer-with/m-p/676773#M42</guid>
      <dc:creator>HusseinNasser2</dc:creator>
      <dc:date>2020-09-18T22:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to Update Feature Layer with Related Table Value</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-update-feature-layer-with/m-p/676774#M43</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;A href="https://community.esri.com/migrated-users/154383"&gt;Hussein Nasser&lt;/A&gt;‌; I missed the FeatureSetByRelationshipName.&amp;nbsp; I'll check it out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Sep 2020 00:45:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-update-feature-layer-with/m-p/676774#M43</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-09-19T00:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to Update Feature Layer with Related Table Value</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-update-feature-layer-with/m-p/676775#M44</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also check out -&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Esri/arcade-expressions/blob/master/attribute_rule_calculation/UpdateParentFeature.md" title="https://github.com/Esri/arcade-expressions/blob/master/attribute_rule_calculation/UpdateParentFeature.md"&gt;arcade-expressions/UpdateParentFeature.md at master · Esri/arcade-expressions · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did not use FeatureSetByRelationship, but did use a PKey/FKey style lookup&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Sep 2020 01:39:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-update-feature-layer-with/m-p/676775#M44</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2020-09-19T01:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to Update Feature Layer with Related Table Value</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-update-feature-layer-with/m-p/676776#M45</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ended up going a different route using dictionaries, so for the sake of discussion, here is what I went with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;var cityDict = {"ALTA" : "ALT", "BRIGHTON" : "BRT", "BLUFFDALE" : "BLU", 
                "COTTONWOOD HEIGHTS" : "COT","DRAPER" : "DRA", "HERRIMAN" : "HER", 
                "HOLLADAY" : "HOL","MIDVALE" : "MID", "MILLCREEK" : "MCK", 
                "MURRAY" : "MUR","RIVERTON": "RIV", "SALT LAKE CITY" : "SLC",
                "SALT LAKE COUNTY" : "SCO", "SANDY" : "SAN", "SOUTH JORDAN" : "SJC",
                "SOUTH SALT LAKE" : "SSL", "TAYLORSVILLE" : "TAY", 
                "WEST JORDAN" : "WJC", "WEST VALLEY" : "WVC"}
var townDict ={"COPPERTON" : "COP", "EMIGRATION CANYON" : "EMC",
            "KEARNS" : "KEA", "MAGNA" : "MAG", 
            "UNINCORPORATED" : "SCO", "WHITE CITY" : "WHC"}


var city = $feature.INCMUNI_L  //$feature.INCMUN_R
var town = $feature.UNINCCOM_L //$feature.UNINCCOM_L

if (HasKey(cityDict, city)){
    return cityDict[city];
} else if (HasKey(townDict, town)){
    return uninc[town]
}
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In my area of operations, we have both incorporated cities as well as unincorporated townships. The field&amp;nbsp; &lt;STRONG&gt;INCMUNI_L&amp;nbsp;&lt;/STRONG&gt;has the value of the incorporated municipality on the left side of a centerline while the field&amp;nbsp;&lt;STRONG&gt;UNINCCOM_L&amp;nbsp;&lt;/STRONG&gt;has the unincorporated community on the left side of a centerline. I should mention that when adding a new centerline, these attributes are updated with another attribute rule that takes the required info from an underlying polygon feature.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two rules, one for the left side of&amp;nbsp;the centerlines feature and one for the right side that update a field called CityCode_L or CItyCode_R respectively using the associated values from the dictionaries.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:31:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-update-feature-layer-with/m-p/676776#M45</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-12T04:31:43Z</dc:date>
    </item>
  </channel>
</rss>

