<?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: Can't Get Arcade to Recognize a New Line in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/can-t-get-arcade-to-recognize-a-new-line/m-p/1591778#M7442</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/660284"&gt;@CamTurney&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You will need to declare your variable like so:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;var percent = $feature.percent;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;You can find more info about declaring variables in the documentation &lt;A href="https://developers.arcgis.com/arcade/guide/variables/" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the comparison operators in your When() statement, you will also need to use == to indicate 'equal to'. In your example you only use =.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the expression should look something like this:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;var percent = $feature.percent;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When(percent == 0, 'Not Hydric', percent &amp;gt; 0 &amp;amp;&amp;amp; percent &amp;lt;50, 'Non-Hydric with Hydric Inclusions', percent &amp;gt;= 50 &amp;amp;&amp;amp; percent &amp;lt; 100, 'Predominantly Hydric', percent == 100, 'Hydric', 'N/A');&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Mar 2025 17:14:27 GMT</pubDate>
    <dc:creator>timcneil</dc:creator>
    <dc:date>2025-03-04T17:14:27Z</dc:date>
    <item>
      <title>Can't Get Arcade to Recognize a New Line</title>
      <link>https://community.esri.com/t5/developers-questions/can-t-get-arcade-to-recognize-a-new-line/m-p/1591764#M7441</link>
      <description>&lt;P&gt;I have an Arcade expression for a When() logical for Field Calculator. I am calculating string field based on the values of a numeric field.&amp;nbsp; However, I keep getting the error&lt;/P&gt;&lt;P&gt;"Invalid expression. Error on line 1. Semicolon or new line expected" I cannot figure out why it is not recognizing the semi colon after I identified the numeric field as a variable.&lt;/P&gt;&lt;P&gt;var $feature.percent;&lt;BR /&gt;When(percent = 0, 'Not Hydric', percent &amp;gt; 0 &amp;amp;&amp;amp; percent &amp;lt;50, 'Non-Hydric with Hydric Inclusions', percent &amp;gt;= 50 &amp;amp;&amp;amp; percent &amp;lt; 100, 'Predominantly Hydric', percent = 100, 'Hydric', 'N/A');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 17:03:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/can-t-get-arcade-to-recognize-a-new-line/m-p/1591764#M7441</guid>
      <dc:creator>CamTurney</dc:creator>
      <dc:date>2025-03-04T17:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Get Arcade to Recognize a New Line</title>
      <link>https://community.esri.com/t5/developers-questions/can-t-get-arcade-to-recognize-a-new-line/m-p/1591778#M7442</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/660284"&gt;@CamTurney&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You will need to declare your variable like so:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;var percent = $feature.percent;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;You can find more info about declaring variables in the documentation &lt;A href="https://developers.arcgis.com/arcade/guide/variables/" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the comparison operators in your When() statement, you will also need to use == to indicate 'equal to'. In your example you only use =.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the expression should look something like this:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;var percent = $feature.percent;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When(percent == 0, 'Not Hydric', percent &amp;gt; 0 &amp;amp;&amp;amp; percent &amp;lt;50, 'Non-Hydric with Hydric Inclusions', percent &amp;gt;= 50 &amp;amp;&amp;amp; percent &amp;lt; 100, 'Predominantly Hydric', percent == 100, 'Hydric', 'N/A');&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 17:14:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/can-t-get-arcade-to-recognize-a-new-line/m-p/1591778#M7442</guid>
      <dc:creator>timcneil</dc:creator>
      <dc:date>2025-03-04T17:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Get Arcade to Recognize a New Line</title>
      <link>https://community.esri.com/t5/developers-questions/can-t-get-arcade-to-recognize-a-new-line/m-p/1591852#M7443</link>
      <description>&lt;P&gt;This solved my problem, Thanks!!&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 18:31:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/can-t-get-arcade-to-recognize-a-new-line/m-p/1591852#M7443</guid>
      <dc:creator>CamTurney</dc:creator>
      <dc:date>2025-03-04T18:31:12Z</dc:date>
    </item>
  </channel>
</rss>

