<?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: Help calculating field from coded domain in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/help-calculating-field-from-coded-domain/m-p/1161855#M53735</link>
    <description>&lt;P&gt;One way I can think of is do a Select by Attribute on the coded value domain field like Code = '314-invasive removal'.&amp;nbsp; Then assuming you've got two new fields added to your feature class (ActivityCode' and 'ActivityDescription', do a Field Calculation on the selected features for the numeric value (314) and a second field calculation for the text value ('invasive removal').&amp;nbsp; Granted it's more manual than automatic but would work.&amp;nbsp; There is a Domain to Table GP tool that exports your domain to a fGDB table that you might be able to use (somehow) for field calcs.&amp;nbsp; Good luck!&lt;/P&gt;</description>
    <pubDate>Wed, 06 Apr 2022 21:22:46 GMT</pubDate>
    <dc:creator>Robert_LeClair</dc:creator>
    <dc:date>2022-04-06T21:22:46Z</dc:date>
    <item>
      <title>Help calculating field from coded domain</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/help-calculating-field-from-coded-domain/m-p/1161836#M53732</link>
      <description>&lt;P&gt;I'm trying to calculate a field in the same record of an attribute table based on the code associated with a coded domain.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a field ("activity") that uses a domain that contains a code (ex: 314) and description (ex: invasive removal). I select the value from the domain drop down that contains both the code and the description (ex: 314-invasive removal) combined when creating a record to match symbology to a style later. I'd like to populate a field ("ActivityCode") in the same record with only the code from the domain so it just prints "314". Then, similarly, another field that just prints the description.&lt;/P&gt;&lt;P&gt;The codes vary in length so using right, left, mid functions won't work unless I can use a string in calculate field to count left &lt;EM&gt;from&lt;/EM&gt; the dash between the code and description?&lt;/P&gt;&lt;P&gt;Or is there a way to calculate the code from what is associated with what I selected?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 20:49:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/help-calculating-field-from-coded-domain/m-p/1161836#M53732</guid>
      <dc:creator>JoeForester</dc:creator>
      <dc:date>2022-04-06T20:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help calculating field from coded domain</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/help-calculating-field-from-coded-domain/m-p/1161855#M53735</link>
      <description>&lt;P&gt;One way I can think of is do a Select by Attribute on the coded value domain field like Code = '314-invasive removal'.&amp;nbsp; Then assuming you've got two new fields added to your feature class (ActivityCode' and 'ActivityDescription', do a Field Calculation on the selected features for the numeric value (314) and a second field calculation for the text value ('invasive removal').&amp;nbsp; Granted it's more manual than automatic but would work.&amp;nbsp; There is a Domain to Table GP tool that exports your domain to a fGDB table that you might be able to use (somehow) for field calcs.&amp;nbsp; Good luck!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 21:22:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/help-calculating-field-from-coded-domain/m-p/1161855#M53735</guid>
      <dc:creator>Robert_LeClair</dc:creator>
      <dc:date>2022-04-06T21:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help calculating field from coded domain</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/help-calculating-field-from-coded-domain/m-p/1161972#M53749</link>
      <description>&lt;UL&gt;&lt;LI&gt;create the fields "ActivityCode" and "ActivityDescription" in your table&lt;/LI&gt;&lt;LI&gt;use the expressions below to &lt;A href="https://pro.arcgis.com/en/pro-app/2.8/tool-reference/data-management/calculate-field.htm" target="_blank" rel="noopener"&gt;calculate the fields&lt;/A&gt; (use Arcade as language)&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="javascript"&gt;// Arcade expressions to calculate ActivityCode and ActivityDescription
// from Activity

// for Code
return Split($feature.Activity, "-")[0]
// for Description
return Split($feature.Activity, "-")[-1]&lt;/LI-CODE&gt;&lt;UL&gt;&lt;LI&gt;if you want this to be one automatically for new or updated features, create an &lt;A href="https://pro.arcgis.com/en/pro-app/2.8/help/data/geodatabases/overview/an-overview-of-attribute-rules.htm" target="_blank" rel="noopener"&gt;Attribute Rule&lt;/A&gt; on your table, use the expression below.&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="javascript"&gt;// Calculation Attribute Rule on your feature class
// field: empy
// triggers: insert, update
var activity_split = Split($feature.Activity, "-")
return {
    "result": {
        "attributes": {
            "AcivityCode": activity_split[0],
            "AcivityDescription": activity_split[-1],
        }
    }
}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 07 Apr 2022 08:36:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/help-calculating-field-from-coded-domain/m-p/1161972#M53749</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-04-07T08:36:56Z</dc:date>
    </item>
  </channel>
</rss>

