<?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 Check if variable matches one of strings in array in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/check-if-variable-matches-one-of-strings-in-array/m-p/1387192#M1307</link>
    <description>&lt;P&gt;Hello, I am just trying to prepare attribute rule to check if $feature.field matches one of strings in an array, and then, if yes, another field is going to be populated with specific attribute value.&lt;/P&gt;&lt;P&gt;I have tried the code below but unfortunately it returned an error, saying "Close Parenthesis expected in line 2"&lt;/P&gt;&lt;P&gt;Much appreciated if anyone point out any cause of the problem or give me a solution.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var array1 = ["Lake", "Mountain", "River"]
if (array1.includes($feature.FeatureType)) {
    return {
        result: {
            attributes: {
                ThemeType: "Nature"
            }
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Feb 2024 04:15:02 GMT</pubDate>
    <dc:creator>TTtttTeee</dc:creator>
    <dc:date>2024-02-27T04:15:02Z</dc:date>
    <item>
      <title>Check if variable matches one of strings in array</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/check-if-variable-matches-one-of-strings-in-array/m-p/1387192#M1307</link>
      <description>&lt;P&gt;Hello, I am just trying to prepare attribute rule to check if $feature.field matches one of strings in an array, and then, if yes, another field is going to be populated with specific attribute value.&lt;/P&gt;&lt;P&gt;I have tried the code below but unfortunately it returned an error, saying "Close Parenthesis expected in line 2"&lt;/P&gt;&lt;P&gt;Much appreciated if anyone point out any cause of the problem or give me a solution.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var array1 = ["Lake", "Mountain", "River"]
if (array1.includes($feature.FeatureType)) {
    return {
        result: {
            attributes: {
                ThemeType: "Nature"
            }
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 04:15:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/check-if-variable-matches-one-of-strings-in-array/m-p/1387192#M1307</guid>
      <dc:creator>TTtttTeee</dc:creator>
      <dc:date>2024-02-27T04:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: Check if variable matches one of strings in array</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/check-if-variable-matches-one-of-strings-in-array/m-p/1387203#M1308</link>
      <description>In arcade, there are no function on arrays. You need to call&lt;BR /&gt;&lt;BR /&gt;Includes(inputArray, value)&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Feb 2024 04:29:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/check-if-variable-matches-one-of-strings-in-array/m-p/1387203#M1308</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2024-02-27T04:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Check if variable matches one of strings in array</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/check-if-variable-matches-one-of-strings-in-array/m-p/1387729#M1311</link>
      <description>&lt;P&gt;Thanks a lot MikeMillerGIS!&lt;/P&gt;&lt;P&gt;It works fine now.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 21:44:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/check-if-variable-matches-one-of-strings-in-array/m-p/1387729#M1311</guid>
      <dc:creator>TTtttTeee</dc:creator>
      <dc:date>2024-02-27T21:44:47Z</dc:date>
    </item>
  </channel>
</rss>

