<?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 Help with Arcade If else statement in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/help-with-arcade-if-else-statement/m-p/1568837#M62858</link>
    <description>&lt;P&gt;Please help me find the error in my code. I am trying to generate a link in a popup based on certain criteria for the address. I got it to work for one specific case but when I try the if else the code won't run.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;if(($feature.STR_TYPE == "AV") &amp;amp;&amp;amp; ($feature.PRE_DIR != NULL)){
  return "http://fileshare.napoleonohio.com/vfolder_frame.ghp?vfolder=/Address%20Files/"+$feature.STR_NAME+"%20ave%20"+$feature.PRE_DIR+"/"+$feature.STR_NUM+"%20"+$feature.STR_NAME+"%20ave%20"+$feature.PRE_DIR;}
else if (($feature.STR_TYPE == "AV") &amp;amp;&amp;amp; ($feature.PRE_DIR = NULL)){
  return "http://fileshare.napoleonohio.com/vfolder_frame.ghp?vfolder=/Address%20Files/"+$feature.STR_NAME+"%20ave"+"/"+$feature.STR_NUM+"%20"+$feature.STR_NAME+"%20ave";}
else if (($feature.STR_TYPE != "AV") &amp;amp;&amp;amp; ($feature.PRE_DIR != NULL)){
  return "http://fileshare.napoleonohio.com/vfolder_frame.ghp?vfolder=/Address%20Files/"+$feature.STR_NAME+"%20+"+$feature.PRE_TYPE+"%20"+$feature.PRE_DIR+"/"+$feature.STR_NUM+"%20"+$feature.STR_NAME+"%20"$feature.PRE_TYPE+"%20"+$feature.PRE_DIR;}
else if (($feature.STR_TYPE != "AV") &amp;amp;&amp;amp; ($feature.PRE_DIR = NULL)){
  return "http://fileshare.napoleonohio.com/vfolder_frame.ghp?vfolder=/Address%20Files/"+$feature.STR_NAME+"%20+"+$feature.PRE_TYPE+"%20"+"/"+$feature.STR_NUM+"%20"+$feature.STR_NAME+"%20"$feature.PRE_TYPE+;}&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 16 Dec 2024 14:21:01 GMT</pubDate>
    <dc:creator>Jmoll</dc:creator>
    <dc:date>2024-12-16T14:21:01Z</dc:date>
    <item>
      <title>Help with Arcade If else statement</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/help-with-arcade-if-else-statement/m-p/1568837#M62858</link>
      <description>&lt;P&gt;Please help me find the error in my code. I am trying to generate a link in a popup based on certain criteria for the address. I got it to work for one specific case but when I try the if else the code won't run.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;if(($feature.STR_TYPE == "AV") &amp;amp;&amp;amp; ($feature.PRE_DIR != NULL)){
  return "http://fileshare.napoleonohio.com/vfolder_frame.ghp?vfolder=/Address%20Files/"+$feature.STR_NAME+"%20ave%20"+$feature.PRE_DIR+"/"+$feature.STR_NUM+"%20"+$feature.STR_NAME+"%20ave%20"+$feature.PRE_DIR;}
else if (($feature.STR_TYPE == "AV") &amp;amp;&amp;amp; ($feature.PRE_DIR = NULL)){
  return "http://fileshare.napoleonohio.com/vfolder_frame.ghp?vfolder=/Address%20Files/"+$feature.STR_NAME+"%20ave"+"/"+$feature.STR_NUM+"%20"+$feature.STR_NAME+"%20ave";}
else if (($feature.STR_TYPE != "AV") &amp;amp;&amp;amp; ($feature.PRE_DIR != NULL)){
  return "http://fileshare.napoleonohio.com/vfolder_frame.ghp?vfolder=/Address%20Files/"+$feature.STR_NAME+"%20+"+$feature.PRE_TYPE+"%20"+$feature.PRE_DIR+"/"+$feature.STR_NUM+"%20"+$feature.STR_NAME+"%20"$feature.PRE_TYPE+"%20"+$feature.PRE_DIR;}
else if (($feature.STR_TYPE != "AV") &amp;amp;&amp;amp; ($feature.PRE_DIR = NULL)){
  return "http://fileshare.napoleonohio.com/vfolder_frame.ghp?vfolder=/Address%20Files/"+$feature.STR_NAME+"%20+"+$feature.PRE_TYPE+"%20"+"/"+$feature.STR_NUM+"%20"+$feature.STR_NAME+"%20"$feature.PRE_TYPE+;}&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 16 Dec 2024 14:21:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/help-with-arcade-if-else-statement/m-p/1568837#M62858</guid>
      <dc:creator>Jmoll</dc:creator>
      <dc:date>2024-12-16T14:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Arcade If else statement</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/help-with-arcade-if-else-statement/m-p/1568841#M62859</link>
      <description>&lt;P&gt;When posting code, please us the "&lt;A href="https://community.esri.com/t5/community-help-documents/how-to-insert-code-in-your-post/ta-p/914552" target="_self"&gt;Insert/Edit code sample&lt;/A&gt;" button. It's much easier to read and analyze rather that trying to replicate it from an image&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 14:17:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/help-with-arcade-if-else-statement/m-p/1568841#M62859</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-12-16T14:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Arcade If else statement</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/help-with-arcade-if-else-statement/m-p/1568849#M62860</link>
      <description>&lt;P&gt;It also helps to post the specific error message rather than saying "the code won't run."&lt;/P&gt;&lt;P&gt;&lt;STRIKE&gt;Although ArcGIS Arcade looks like JavaScript, it isn't JavaScript.&amp;nbsp; There is no "else if" construct in Arcade, refer to &lt;/STRIKE&gt;&lt;A href="https://developers.arcgis.com/arcade/guide/logic/" target="_blank" rel="noopener"&gt;&lt;STRIKE&gt;If - else | ArcGIS Arcade | Esri Developer.&lt;/STRIKE&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Additionally, there is almost always a better logical construct/function than using large if/else blocks.&amp;nbsp; I encourage you to explore using When.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 15:14:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/help-with-arcade-if-else-statement/m-p/1568849#M62860</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2024-12-16T15:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Arcade If else statement</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/help-with-arcade-if-else-statement/m-p/1568860#M62861</link>
      <description>&lt;P&gt;You were missing a extra "=" on line 3&lt;/P&gt;&lt;P&gt;$feature.PRE_DIR =&lt;FONT color="#FF0000"&gt;=&lt;/FONT&gt; NULL&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if(($feature.STR_TYPE == "AV") &amp;amp;&amp;amp; ($feature.PRE_DIR != NULL)){
  return "http://fileshare.napoleonohio.com/vfolder_frame.ghp?vfolder=/Address%20Files/"+$feature.STR_NAME+"%20ave%20"+$feature.PRE_DIR+"/"+$feature.STR_NUM+"%20"+$feature.STR_NAME+"%20ave%20"+$feature.PRE_DIR;}
else if (($feature.STR_TYPE == "AV") &amp;amp;&amp;amp; ($feature.PRE_DIR == NULL)){
  return "http://fileshare.napoleonohio.com/vfolder_frame.ghp?vfolder=/Address%20Files/"+$feature.STR_NAME+"%20ave"+"/"+$feature.STR_NUM+"%20"+$feature.STR_NAME+"%20ave";}
else if (($feature.STR_TYPE != "AV") &amp;amp;&amp;amp; ($feature.PRE_DIR != NULL)){
  return "http://fileshare.napoleonohio.com/vfolder_frame.ghp?vfolder=/Address%20Files/"+$feature.STR_NAME+"%20+"+$feature.PRE_TYPE+"%20"+$feature.PRE_DIR+"/"+$feature.STR_NUM+"%20"+$feature.STR_NAME+"%20"$feature.PRE_TYPE+"%20"+$feature.PRE_DIR;}
else if (($feature.STR_TYPE != "AV") &amp;amp;&amp;amp; ($feature.PRE_DIR = NULL)){
  return "http://fileshare.napoleonohio.com/vfolder_frame.ghp?vfolder=/Address%20Files/"+$feature.STR_NAME+"%20+"+$feature.PRE_TYPE+"%20"+"/"+$feature.STR_NUM+"%20"+$feature.STR_NAME+"%20"$feature.PRE_TYPE+;}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 14:44:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/help-with-arcade-if-else-statement/m-p/1568860#M62861</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-12-16T14:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Arcade If else statement</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/help-with-arcade-if-else-statement/m-p/1568863#M62862</link>
      <description>&lt;P&gt;You can use "else if" in a if/else block, but I do agree that using When is a better solution.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 14:46:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/help-with-arcade-if-else-statement/m-p/1568863#M62862</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-12-16T14:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Arcade If else statement</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/help-with-arcade-if-else-statement/m-p/1568865#M62863</link>
      <description>&lt;P&gt;Thank you both, I fixed the error and will try to use When instead!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 14:47:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/help-with-arcade-if-else-statement/m-p/1568865#M62863</guid>
      <dc:creator>Jmoll</dc:creator>
      <dc:date>2024-12-16T14:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Arcade If else statement</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/help-with-arcade-if-else-statement/m-p/1568886#M62864</link>
      <description>&lt;P&gt;Ken, interesting, their documentation implies it isn't supported since they fully nest a single if/else statement within the else portion of another statement instead of using "else if" directly.&amp;nbsp; I know there are certain common JavaScript constructs that Arcade doesn't support, I just thought "else if" was another.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 15:13:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/help-with-arcade-if-else-statement/m-p/1568886#M62864</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2024-12-16T15:13:47Z</dc:date>
    </item>
  </channel>
</rss>

