<?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 Labeling IF/ELSE Statements in ArcGIS Online Developers Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-labeling-if-else-statements/m-p/1546509#M1486</link>
    <description>&lt;P&gt;Here's another way of doing this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fields = ['JT', 'Veg', 'Plants', 'BUOW', 'CBB', 'DT', 'JD']
var output = []
for (var f in fields) {
  var field = fields[f]
  if ($feature[field] == 'Yes') Push(output, field)
}
When (Count(output) == 0, "NO SURVEYS COMPLETED",
      Count(output) == 7, "ALL SURVEYS COMPLETED",
      "Completed Surveys: " + Concatenate(output, "; "))&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 08 Oct 2024 13:35:32 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2024-10-08T13:35:32Z</dc:date>
    <item>
      <title>Arcade Labeling IF/ELSE Statements</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-labeling-if-else-statements/m-p/1546381#M1484</link>
      <description>&lt;P&gt;I'm trying to create a map label that lists all of the completed surveys.&amp;nbsp; If none of the surveys have been completed, I want that noted; conversely, if all of the surveys have been completed, I want that noted.&amp;nbsp; That way, the surveyor doesn't need to read the whole list of completed surveys.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I have so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var JT1 = $feature.JT
var veg1 = $feature.Veg
var plants1 = $feature.Plants 
var BUOW1 = $feature.BUOW
var CBB1 = $feature.CBB
var DT1 = $feature.DT
var JD1 = $feature.JD

var JT = IIF(JT1 == "Yes", "JT; ", "");
var veg = IIF(veg1 == "Yes", "Veg; ", "");
var plants = IIF(plants1 == "Yes", "Plants; ", "");
var BUOW = IIF(BUOW1 == "Yes", "BUOW; ", "");
var CBB = IIF(CBB1 == "Yes", "CBB; ", "");
var DT = IIF(DT1 == "Yes", "DT; ", "");
var JD = IIF(JD1 == "Yes", "JD; ", "");

if (JT1 == "Yes" AND veg1 == "Yes" AND plants1 == "Yes" AND BUOW1 == "Yes" AND CBB1 == "Yes" AND DT1 == "Yes" AND JD1 == "Yes"){
    return "ALL SURVEYS COMPLETED"
} else if (JT1 != "Yes" AND veg1 != "Yes" AND plants1 != "Yes" AND BUOW1 != "Yes" AND CBB1 != "Yes" AND DT1 != "Yes" AND JD1 != "Yes"){
    return "NO SURVEYS COMPLETED"
} else {
    return "Completed Surveys: " + JT + veg + plants + BUOW + CBB + DT + JD
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;... but I'm getting the error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;')' expected.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 01:08:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-labeling-if-else-statements/m-p/1546381#M1484</guid>
      <dc:creator>BrittanyGale</dc:creator>
      <dc:date>2024-10-08T01:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Labeling IF/ELSE Statements</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-labeling-if-else-statements/m-p/1546442#M1485</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/184787"&gt;@BrittanyGale&lt;/a&gt;&amp;nbsp; do&amp;nbsp;you need to use these Logical Operators rather than the word AND ?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://developers.arcgis.com/arcade/guide/operators/#logical-operators" target="_blank"&gt;https://developers.arcgis.com/arcade/guide/operators/#logical-operators&lt;/A&gt;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;if (JT1 == "Yes" &amp;amp;&amp;amp; veg1 == "Yes" &amp;amp;&amp;amp; plants1 == "Yes" &amp;amp;&amp;amp; BUOW1 == "Yes" &amp;amp;&amp;amp; CBB1 == "Yes" &amp;amp;&amp;amp; DT1 == "Yes" &amp;amp;&amp;amp; JD1 == "Yes"){
    return "ALL SURVEYS COMPLETED"
} else if (JT1 != "Yes" &amp;amp;&amp;amp; veg1 != "Yes" &amp;amp;&amp;amp; plants1 != "Yes" &amp;amp;&amp;amp; BUOW1 != "Yes" &amp;amp;&amp;amp; CBB1 != "Yes" &amp;amp;&amp;amp; DT1 != "Yes" &amp;amp;&amp;amp; JD1 != "Yes"){
    return "NO SURVEYS COMPLETED"
} else {
    return "Completed Surveys: " + JT + veg + plants + BUOW + CBB + DT + JD
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 09:26:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-labeling-if-else-statements/m-p/1546442#M1485</guid>
      <dc:creator>ChrisUnderwood</dc:creator>
      <dc:date>2024-10-08T09:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Labeling IF/ELSE Statements</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-labeling-if-else-statements/m-p/1546509#M1486</link>
      <description>&lt;P&gt;Here's another way of doing this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fields = ['JT', 'Veg', 'Plants', 'BUOW', 'CBB', 'DT', 'JD']
var output = []
for (var f in fields) {
  var field = fields[f]
  if ($feature[field] == 'Yes') Push(output, field)
}
When (Count(output) == 0, "NO SURVEYS COMPLETED",
      Count(output) == 7, "ALL SURVEYS COMPLETED",
      "Completed Surveys: " + Concatenate(output, "; "))&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 08 Oct 2024 13:35:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-labeling-if-else-statements/m-p/1546509#M1486</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-10-08T13:35:32Z</dc:date>
    </item>
  </channel>
</rss>

