<?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 question: checking if value is in a list in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-syntax-question-checking-if-value-is-in-a/m-p/199424#M9896</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick reply! That works!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Aug 2020 14:37:28 GMT</pubDate>
    <dc:creator>Katie_Clark</dc:creator>
    <dc:date>2020-08-17T14:37:28Z</dc:date>
    <item>
      <title>Arcade syntax question: checking if value is in a list</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-syntax-question-checking-if-value-is-in-a/m-p/199422#M9894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am hoping this is a fairly simple question but I'm just a bit unclear on the syntax for Arcade and haven't&amp;nbsp;been able to find the answer I need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to return a certain value based on whether the county name is in a predefined list or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;var counties = ['County1', 'County2']
if ( $feature.NAME IN counties ) {
return "Processed"
}
else {
return "Not Processed"
}&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any guidance!&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;KC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:56:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-syntax-question-checking-if-value-is-in-a/m-p/199422#M9894</guid>
      <dc:creator>Katie_Clark</dc:creator>
      <dc:date>2021-12-11T09:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade syntax question: checking if value is in a list</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-syntax-question-checking-if-value-is-in-a/m-p/199423#M9895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if this is the offical&amp;nbsp;way of doing this but if you use indexOf(list, value) and the value isn't in the list it returns a -1, so you can set up a little switch using it! See below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; counties &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'County1'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'County2'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="token function"&gt;IIF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;indexOf&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;counties&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NAME&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Processed"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Not Processed"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:56:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-syntax-question-checking-if-value-is-in-a/m-p/199423#M9895</guid>
      <dc:creator>JoshuaSharp-Heward</dc:creator>
      <dc:date>2021-12-11T09:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade syntax question: checking if value is in a list</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-syntax-question-checking-if-value-is-in-a/m-p/199424#M9896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick reply! That works!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2020 14:37:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-syntax-question-checking-if-value-is-in-a/m-p/199424#M9896</guid>
      <dc:creator>Katie_Clark</dc:creator>
      <dc:date>2020-08-17T14:37:28Z</dc:date>
    </item>
  </channel>
</rss>

