<?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: Undefined Keyword Error in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/undefined-keyword-error/m-p/1494495#M1500</link>
    <description>&lt;P&gt;Fixed!&amp;nbsp; Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/454087"&gt;@Jake_S&lt;/a&gt;!&lt;/P&gt;</description>
    <pubDate>Tue, 18 Jun 2024 17:08:32 GMT</pubDate>
    <dc:creator>BillMoody</dc:creator>
    <dc:date>2024-06-18T17:08:32Z</dc:date>
    <item>
      <title>Undefined Keyword Error</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/undefined-keyword-error/m-p/1494452#M1498</link>
      <description>&lt;P&gt;Trying to create a fairly simple attribute rule on a line feature that will take various values from a table and divide them by another field containing the calculated length of the segment in miles and then return the result to the appropriate fields.&amp;nbsp; This is set to trigger on insert and update&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// Retrieve values and handle nulls
var lengthMiles = $feature.LengthMiles;
var totalCrashes = DefaultValue($feature.TotalCrashes, 0);
var fatalCrashes = DefaultValue($feature.FatalCrashes, 0);
var injuryCrashes = DefaultValue($feature.InjuryCrashes, 0);
var propertyCrashes = DefaultValue($feature.PropertyCrashes, 0);
var pedestrianGenerator = DefaultValue($feature.PedestrianGenerator, 0);

// Initialize the result dictionary
var result = {
    'CrashesPerMile': 0,
    'FatalCrashes_PerMile': 0,
    'InjuryCrashes_PerMile': 0,
    'PropertyCrashes_PerMile': 0,
    'PedGen_PerMile': 0
};

// Calculate per mile values if lengthMiles is greater than 0
if (lengthMiles &amp;gt; 0) {
    result['CrashesPerMile'] = totalCrashes / lengthMiles;
    result['FatalCrashes_PerMile'] = fatalCrashes / lengthMiles;
    result['InjuryCrashes_PerMile'] = injuryCrashes / lengthMiles;
    result['PropertyCrashes_PerMile'] = propertyCrashes / lengthMiles;
    result['PedGen_PerMile'] = pedestrianGenerator / lengthMiles;
}

// Return the result object
return result;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The check tells me that the rule is valid&amp;nbsp; but when I go to create a new line on the map, I get this error:&lt;BR /&gt;Triggering event: Insert,&lt;BR /&gt;Class name: PublicWorksInternal.DBO.TrafficCalmingProjects,&lt;BR /&gt;GlobalID: {345DBCDD-2B43-4EF1-9BF8-94F0A82ACFBA}]Undefined keyword is used in the dictionary return script. [CrashesPerMile]&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any help!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 16:00:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/undefined-keyword-error/m-p/1494452#M1498</guid>
      <dc:creator>BillMoody</dc:creator>
      <dc:date>2024-06-18T16:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Undefined Keyword Error</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/undefined-keyword-error/m-p/1494489#M1499</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/59878"&gt;@BillMoody&lt;/a&gt;&amp;nbsp;you'll need to use proper distortionary keywords to insert the values into the proper attributes. The documentation is here,&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/attribute-rule-dictionary-keywords.htm" target="_self"&gt;Attribute rule dictionary keywords&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;~Jake&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 16:52:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/undefined-keyword-error/m-p/1494489#M1499</guid>
      <dc:creator>Jake_S</dc:creator>
      <dc:date>2024-06-18T16:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Undefined Keyword Error</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/undefined-keyword-error/m-p/1494495#M1500</link>
      <description>&lt;P&gt;Fixed!&amp;nbsp; Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/454087"&gt;@Jake_S&lt;/a&gt;!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 17:08:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/undefined-keyword-error/m-p/1494495#M1500</guid>
      <dc:creator>BillMoody</dc:creator>
      <dc:date>2024-06-18T17:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Undefined Keyword Error</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/undefined-keyword-error/m-p/1494498#M1501</link>
      <description>&lt;P&gt;Most welcome!!&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/59878"&gt;@BillMoody&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 17:14:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/undefined-keyword-error/m-p/1494498#M1501</guid>
      <dc:creator>Jake_S</dc:creator>
      <dc:date>2024-06-18T17:14:11Z</dc:date>
    </item>
  </channel>
</rss>

