<?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: How to query for Features in a Domain string attribute field in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-query-for-features-in-a-domain-string/m-p/35285#M2934</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried animal = '1', to test if an index number would return values, but it's not the case...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My customer set it up in AGOL. I changed it to animals to simplify the question. I made a screenshot of the actual attribute in AGOL. It is a 'status' attribute with a pre-defined string value list (Domain). Sorry it is in Dutch.&lt;/P&gt;&lt;P&gt;In AGOL, selecting this attribute in the table, shows a popup with the 3 strings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Screenshot from AGOL atribute" class="jive-emoji image-1 jive-image j-img-original" src="/legacyfs/online/490206_Screenshot 2020-04-28 at 15.42.07.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Apr 2020 13:49:18 GMT</pubDate>
    <dc:creator>PHerk</dc:creator>
    <dc:date>2020-04-28T13:49:18Z</dc:date>
    <item>
      <title>How to query for Features in a Domain string attribute field</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-query-for-features-in-a-domain-string/m-p/35283#M2932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;For my customer I am building an application where I query a Featurelayer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function queryFeatureLayer() {&lt;BR /&gt; var query = {&lt;BR /&gt; spatialRelationship: "intersects",&lt;BR /&gt; outFields: ["*"],&lt;BR /&gt; returnGeometry: true,&lt;BR /&gt; where: field = value&lt;BR /&gt; };&lt;BR /&gt; featurelayer.queryFeatures(query).then(function(result) {&lt;BR /&gt; //&amp;nbsp;handle results&lt;BR /&gt;});&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works for a simple attribute&amp;nbsp;field (string) .&lt;/P&gt;&lt;P&gt;Assume field = "animal", value = "dog"&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;where: "animal" = &lt;SPAN&gt;"dog"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;This returns all features that have the string "dog" in this field.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Now the "animal" field&amp;nbsp;is changed to hold a &amp;nbsp;string-list, a domain. In AGOL this&amp;nbsp;gives a popup list&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;with a few animals Assume: ("dog", "cat", "mouse").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to query this field but I get errors using:&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;SPAN&gt;where: "animal = dog"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;where: "animal = 1"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cannot perform query. Invalid query parameters.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How can I set up a&amp;nbsp;working&amp;nbsp;&lt;/SPAN&gt;query to search for all Features that have "dog" set in field "animal" using a Domain string attribute field?&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2020 13:05:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-query-for-features-in-a-domain-string/m-p/35283#M2932</guid>
      <dc:creator>PHerk</dc:creator>
      <dc:date>2020-04-28T13:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to query for Features in a Domain string attribute field</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-query-for-features-in-a-domain-string/m-p/35284#M2933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the value actually stored in the feature for the attribute? When you look at that table in ArcMap does it have 1 for a Dog?&lt;/P&gt;&lt;P&gt;It sounds like you are saying that the domain is a coded domain using a string thus the query would need to be:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;animal = '1'&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2020 13:17:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-query-for-features-in-a-domain-string/m-p/35284#M2933</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-04-28T13:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to query for Features in a Domain string attribute field</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-query-for-features-in-a-domain-string/m-p/35285#M2934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried animal = '1', to test if an index number would return values, but it's not the case...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My customer set it up in AGOL. I changed it to animals to simplify the question. I made a screenshot of the actual attribute in AGOL. It is a 'status' attribute with a pre-defined string value list (Domain). Sorry it is in Dutch.&lt;/P&gt;&lt;P&gt;In AGOL, selecting this attribute in the table, shows a popup with the 3 strings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Screenshot from AGOL atribute" class="jive-emoji image-1 jive-image j-img-original" src="/legacyfs/online/490206_Screenshot 2020-04-28 at 15.42.07.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2020 13:49:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-query-for-features-in-a-domain-string/m-p/35285#M2934</guid>
      <dc:creator>PHerk</dc:creator>
      <dc:date>2020-04-28T13:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to query for Features in a Domain string attribute field</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-query-for-features-in-a-domain-string/m-p/35286#M2935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So does status = 'gepland' work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2020 13:55:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-query-for-features-in-a-domain-string/m-p/35286#M2935</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-04-28T13:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to query for Features in a Domain string attribute field</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-query-for-features-in-a-domain-string/m-p/35287#M2936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, I tried all 3 strings, "nieuw", "gepland" and "uitgevoerd" but all fail.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2020 14:00:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-query-for-features-in-a-domain-string/m-p/35287#M2936</guid>
      <dc:creator>PHerk</dc:creator>
      <dc:date>2020-04-28T14:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to query for Features in a Domain string attribute field</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-query-for-features-in-a-domain-string/m-p/35288#M2937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And status = '1' does not work? (single quotes is important).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2020 14:12:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-query-for-features-in-a-domain-string/m-p/35288#M2937</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-04-28T14:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to query for Features in a Domain string attribute field</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-query-for-features-in-a-domain-string/m-p/35289#M2938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, but the single ' solved it.&lt;/P&gt;&lt;P&gt;I was misled because I got results without the single quotes on an Attribute Field without a domain list attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For others with the same issue:&lt;/P&gt;&lt;P style="border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;where: "animal = dog" works on an Attribute &lt;SPAN&gt;F&lt;/SPAN&gt;&lt;SPAN&gt;ield&lt;/SPAN&gt; which is just a string.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;where: "animal = dog" fails&amp;nbsp;on an Attribute &lt;SPAN&gt;F&lt;/SPAN&gt;&lt;SPAN&gt;ield&lt;/SPAN&gt; which has a Domain list attached.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;solution:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;Always use:&amp;nbsp;&lt;SPAN&gt;"animal = 'dog'"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you Robert. Appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2020 14:32:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-query-for-features-in-a-domain-string/m-p/35289#M2938</guid>
      <dc:creator>PHerk</dc:creator>
      <dc:date>2020-04-28T14:32:54Z</dc:date>
    </item>
  </channel>
</rss>

