<?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 Arcade script not calculating properly in ArcGIS Arcade Questions</title>
    <link>https://community.esri.com/t5/arcgis-arcade-questions/arcade-script-not-calculating-properly/m-p/1693880#M143</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a bit of a conundrum.&lt;/P&gt;&lt;P&gt;I have a simple arcade script that returns a calculation based on a value. When I entered "ABT", the script makes the correct calculation, but when I enter "Park" or "Street", the script returns "750"&amp;nbsp;&lt;BR /&gt;Any reason why the else if function wouldnt work?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here is the script&lt;/P&gt;&lt;LI-CODE lang="php"&gt;var SpacTypeClass = $feature.SpactypeCLASS;
var API = ($feature.Appraised_Trunk_Increase)


if (SpacTypeClass == 'ABT') {
    return ((API * 6.51) + 5000);
} else if (SpacTypeClass == 'Street') {
    return ((API * 6.51) + 750);
} else if (SpacTypeClass == 'Park') {
    return ((API * 6.51) + 750);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Justin&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Apr 2026 12:57:42 GMT</pubDate>
    <dc:creator>JustinBernard1886</dc:creator>
    <dc:date>2026-04-01T12:57:42Z</dc:date>
    <item>
      <title>Arcade script not calculating properly</title>
      <link>https://community.esri.com/t5/arcgis-arcade-questions/arcade-script-not-calculating-properly/m-p/1693880#M143</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a bit of a conundrum.&lt;/P&gt;&lt;P&gt;I have a simple arcade script that returns a calculation based on a value. When I entered "ABT", the script makes the correct calculation, but when I enter "Park" or "Street", the script returns "750"&amp;nbsp;&lt;BR /&gt;Any reason why the else if function wouldnt work?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here is the script&lt;/P&gt;&lt;LI-CODE lang="php"&gt;var SpacTypeClass = $feature.SpactypeCLASS;
var API = ($feature.Appraised_Trunk_Increase)


if (SpacTypeClass == 'ABT') {
    return ((API * 6.51) + 5000);
} else if (SpacTypeClass == 'Street') {
    return ((API * 6.51) + 750);
} else if (SpacTypeClass == 'Park') {
    return ((API * 6.51) + 750);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Justin&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2026 12:57:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-arcade-questions/arcade-script-not-calculating-properly/m-p/1693880#M143</guid>
      <dc:creator>JustinBernard1886</dc:creator>
      <dc:date>2026-04-01T12:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade script not calculating properly</title>
      <link>https://community.esri.com/t5/arcgis-arcade-questions/arcade-script-not-calculating-properly/m-p/1693891#M144</link>
      <description>&lt;P&gt;It worked for me? Best guess is you just don't have any values in the API field for the other two, or the value is 0.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-04-01 071752.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/150529iF953592EBB4C6759/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2026-04-01 071752.png" alt="Screenshot 2026-04-01 071752.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2026 13:20:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-arcade-questions/arcade-script-not-calculating-properly/m-p/1693891#M144</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2026-04-01T13:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade script not calculating properly</title>
      <link>https://community.esri.com/t5/arcgis-arcade-questions/arcade-script-not-calculating-properly/m-p/1693892#M145</link>
      <description>&lt;P&gt;Have you considered a When statement instead of the nested if else?&lt;/P&gt;&lt;P&gt;something like:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var spClass =
  When(
    SpacTypeClass == 'ABT', 5000,
    SpacTypeClass == 'Street', 750,
    SpacTypeClass == 'Park', 750,  
  );
return (API * 6.51) + spClass;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also if it is just returning&amp;nbsp; "750" for Street and Park, your calc may be working but API is returning 0 for those cases.&amp;nbsp; Double check that an API exists for those.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2026 13:21:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-arcade-questions/arcade-script-not-calculating-properly/m-p/1693892#M145</guid>
      <dc:creator>Neal_t_k</dc:creator>
      <dc:date>2026-04-01T13:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade script not calculating properly</title>
      <link>https://community.esri.com/t5/arcgis-arcade-questions/arcade-script-not-calculating-properly/m-p/1694004#M146</link>
      <description>&lt;P&gt;Hey guys,&lt;/P&gt;&lt;P&gt;Thanks for all the help. It hit me, that the issue was the order of the attributes rules. I needed to rearrange them so the API rule calculated first. Before it was calculating AFTER the rule I posted, so it was returning zero. I reordered the rules and I am now getting the correct result.&lt;BR /&gt;&lt;BR /&gt;Thanks for the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2026 17:29:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-arcade-questions/arcade-script-not-calculating-properly/m-p/1694004#M146</guid>
      <dc:creator>JustinBernard1886</dc:creator>
      <dc:date>2026-04-01T17:29:17Z</dc:date>
    </item>
  </channel>
</rss>

