<?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 ERROR 002717: Invalid Arcade expression, Arcade error: Index out of bounds in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/error-002717-invalid-arcade-expression-arcade/m-p/1222682#M609</link>
    <description>&lt;P&gt;I am trying to add an attribute rule to a file geodatabase that contains an LRS Dataset (created using ArcGIS Roads and Highways) which has routes (polylines) with measures.&amp;nbsp; I am using ArcGIS Pro 3.0.2 and I get the error below from these parameters:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GraemeBrowning_Aurizon_0-1666053813645.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/53796iA708AD080A8854C6/image-size/large?v=v2&amp;amp;px=999" role="button" title="GraemeBrowning_Aurizon_0-1666053813645.png" alt="GraemeBrowning_Aurizon_0-1666053813645.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var arrName = split($feature.RouteName,'_');
return Number(arrName[1],'####KM') + (Geometry($feature).paths[-1][-1].m/10000)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR 002717: Invalid Arcade expression, Arcade error: Index out of bounds, Script line: 2&lt;/P&gt;&lt;P&gt;The same code runs without a problem when I use it within the Calculate Field tool on the same data:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GraemeBrowning_Aurizon_1-1666054123886.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/53797iB76B2D8327CC9782/image-size/large?v=v2&amp;amp;px=999" role="button" title="GraemeBrowning_Aurizon_1-1666054123886.png" alt="GraemeBrowning_Aurizon_1-1666054123886.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The same code gives the same error when I try to use it with Add Attribute Rule within an ArcPy/Python script.&lt;/P&gt;&lt;P&gt;The same code cannot be saved as an Attribute Rule when I try to add it manually using the Attribute Rules view.&lt;/P&gt;&lt;P&gt;The same&amp;nbsp;code gives the same error when I try to use it with the Add Attribute Rule&amp;nbsp; tool dialog against the same LRS Dataset loaded into an Enterprise Geodatabase (SQL Server).&lt;/P&gt;&lt;P&gt;The values in $feature.RouteName all conform to patterns like:&lt;/P&gt;&lt;P&gt;AA-TEST_0000KM&lt;/P&gt;&lt;P&gt;ZZ-TEST_0099KM&lt;/P&gt;&lt;P&gt;Is there an alternative Arcade syntax that I can try?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Oct 2022 01:09:50 GMT</pubDate>
    <dc:creator>GraemeBrowning_Aurizon</dc:creator>
    <dc:date>2022-10-18T01:09:50Z</dc:date>
    <item>
      <title>ERROR 002717: Invalid Arcade expression, Arcade error: Index out of bounds</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/error-002717-invalid-arcade-expression-arcade/m-p/1222682#M609</link>
      <description>&lt;P&gt;I am trying to add an attribute rule to a file geodatabase that contains an LRS Dataset (created using ArcGIS Roads and Highways) which has routes (polylines) with measures.&amp;nbsp; I am using ArcGIS Pro 3.0.2 and I get the error below from these parameters:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GraemeBrowning_Aurizon_0-1666053813645.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/53796iA708AD080A8854C6/image-size/large?v=v2&amp;amp;px=999" role="button" title="GraemeBrowning_Aurizon_0-1666053813645.png" alt="GraemeBrowning_Aurizon_0-1666053813645.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var arrName = split($feature.RouteName,'_');
return Number(arrName[1],'####KM') + (Geometry($feature).paths[-1][-1].m/10000)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR 002717: Invalid Arcade expression, Arcade error: Index out of bounds, Script line: 2&lt;/P&gt;&lt;P&gt;The same code runs without a problem when I use it within the Calculate Field tool on the same data:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GraemeBrowning_Aurizon_1-1666054123886.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/53797iB76B2D8327CC9782/image-size/large?v=v2&amp;amp;px=999" role="button" title="GraemeBrowning_Aurizon_1-1666054123886.png" alt="GraemeBrowning_Aurizon_1-1666054123886.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The same code gives the same error when I try to use it with Add Attribute Rule within an ArcPy/Python script.&lt;/P&gt;&lt;P&gt;The same code cannot be saved as an Attribute Rule when I try to add it manually using the Attribute Rules view.&lt;/P&gt;&lt;P&gt;The same&amp;nbsp;code gives the same error when I try to use it with the Add Attribute Rule&amp;nbsp; tool dialog against the same LRS Dataset loaded into an Enterprise Geodatabase (SQL Server).&lt;/P&gt;&lt;P&gt;The values in $feature.RouteName all conform to patterns like:&lt;/P&gt;&lt;P&gt;AA-TEST_0000KM&lt;/P&gt;&lt;P&gt;ZZ-TEST_0099KM&lt;/P&gt;&lt;P&gt;Is there an alternative Arcade syntax that I can try?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 01:09:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/error-002717-invalid-arcade-expression-arcade/m-p/1222682#M609</guid>
      <dc:creator>GraemeBrowning_Aurizon</dc:creator>
      <dc:date>2022-10-18T01:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 002717: Invalid Arcade expression, Arcade error: Index out of bounds</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/error-002717-invalid-arcade-expression-arcade/m-p/1222706#M610</link>
      <description>&lt;P&gt;I was able to work around this by replacing my Arcade expression of:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var arrName = split($feature.RouteName,'_');
return Number(arrName[1],'####KM') + (Geometry($feature).paths[-1][-1].m/10000)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with another which returns the same expected result for my data of:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return Number(Mid($feature.RouteName,8,4)) + ($feature.END_M/10000)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 04:58:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/error-002717-invalid-arcade-expression-arcade/m-p/1222706#M610</guid>
      <dc:creator>GraemeBrowning_Aurizon</dc:creator>
      <dc:date>2022-10-18T04:58:55Z</dc:date>
    </item>
  </channel>
</rss>

