<?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: Arcade syntax different for shapefile vs feature service? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-syntax-different-for-shapefile-vs-feature/m-p/1289304#M69191</link>
    <description>&lt;P&gt;I am able to reproduce that error IF there is a value in the label field that is null or does not contain a comma.....&lt;/P&gt;&lt;P&gt;Along with&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;stated, you can also put some console() statements in there to see what is actually being returned from the representative row:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RhettZufelt_0-1684179068009.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/70723i3DC63CE19886DD1B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RhettZufelt_0-1684179068009.png" alt="RhettZufelt_0-1684179068009.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
    <pubDate>Mon, 15 May 2023 19:33:35 GMT</pubDate>
    <dc:creator>RhettZufelt</dc:creator>
    <dc:date>2023-05-15T19:33:35Z</dc:date>
    <item>
      <title>Arcade syntax different for shapefile vs feature service?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-syntax-different-for-shapefile-vs-feature/m-p/1289250#M69185</link>
      <description>&lt;P&gt;I've run into an issue here where the same exact expression will be validated and work fine for the shapefile version of a layer, but not the web version. The only difference is the field name (truncated in the shapefile). It's a text field.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rburke_0-1684173779849.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/70704i470AD8896A690A4C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rburke_0-1684173779849.png" alt="rburke_0-1684173779849.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Shapefile on right, feature service on left.&lt;/P&gt;&lt;P&gt;It throws an error that the index is out of bounds. Is it just looking at a random feature, seeing a null value, and assuming none of the features have values? For features with no county signed route, in the shapefile, they are just populated with a space. A typical field with a value reads something like 'STATE OF IOWA, Z 16, N' and the Arcade spits out Z16 as its label.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rburke_1-1684174176659.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/70705i5E5CF2439CA70BD8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rburke_1-1684174176659.png" alt="rburke_1-1684174176659.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Taking suggestions on how to work around this. Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 18:09:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-syntax-different-for-shapefile-vs-feature/m-p/1289250#M69185</guid>
      <dc:creator>wayfaringrob</dc:creator>
      <dc:date>2023-05-15T18:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade syntax different for shapefile vs feature service?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-syntax-different-for-shapefile-vs-feature/m-p/1289294#M69188</link>
      <description>&lt;P&gt;Hmm, I couldn't reproduce that behavior, the syntax does not differ.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A possible explanation could be that your service contains values for which the expression fails, eg null values&amp;nbsp; or strings without commas, strings where there is no space after the comma.&lt;/P&gt;&lt;P&gt;Workarounds:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;don't split by ", ", just use the comma without space&lt;/LI&gt;&lt;LI&gt;check the length of the split. if it's 1, return a default value (eg the whole string, or an error message)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var f = Replace($feature.TextField2, " ", "")
var f_split = Split(f, ",")
if(Count(f_split) &amp;gt; 1) { return f_split[1] }
return f&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 15 May 2023 19:15:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-syntax-different-for-shapefile-vs-feature/m-p/1289294#M69188</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-05-15T19:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade syntax different for shapefile vs feature service?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-syntax-different-for-shapefile-vs-feature/m-p/1289300#M69190</link>
      <description>&lt;P&gt;Yes I think there's some more robust validation happening for the Feature Service input.&amp;nbsp; I'd go with Johannes's solution.&amp;nbsp;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/515809"&gt;@Johannes&lt;/a&gt;&amp;nbsp;there's still no Try - Except equivalent in Arcade is there?&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 19:29:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-syntax-different-for-shapefile-vs-feature/m-p/1289300#M69190</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2023-05-15T19:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade syntax different for shapefile vs feature service?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-syntax-different-for-shapefile-vs-feature/m-p/1289304#M69191</link>
      <description>&lt;P&gt;I am able to reproduce that error IF there is a value in the label field that is null or does not contain a comma.....&lt;/P&gt;&lt;P&gt;Along with&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;stated, you can also put some console() statements in there to see what is actually being returned from the representative row:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RhettZufelt_0-1684179068009.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/70723i3DC63CE19886DD1B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RhettZufelt_0-1684179068009.png" alt="RhettZufelt_0-1684179068009.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 19:33:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-syntax-different-for-shapefile-vs-feature/m-p/1289304#M69191</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2023-05-15T19:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade syntax different for shapefile vs feature service?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-syntax-different-for-shapefile-vs-feature/m-p/1289305#M69192</link>
      <description>&lt;P&gt;Nope still waiting on that one. Related idea:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-pro-ideas/add-error-handling-try-catch-to-arcade-language/idi-p/1047180" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/arcgis-pro-ideas/add-error-handling-try-catch-to-arcade-language/idi-p/1047180&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 19:34:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-syntax-different-for-shapefile-vs-feature/m-p/1289305#M69192</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-05-15T19:34:20Z</dc:date>
    </item>
  </channel>
</rss>

