<?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: Querying a Feature Layer doesn't work in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-a-feature-layer-doesn-t-work/m-p/475052#M44086</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved it. Turns out I was using the url for Feature Service. Not the layer itself. Fixing the url works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 May 2019 19:00:37 GMT</pubDate>
    <dc:creator>Kevin_C</dc:creator>
    <dc:date>2019-05-01T19:00:37Z</dc:date>
    <item>
      <title>Querying a Feature Layer doesn't work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-a-feature-layer-doesn-t-work/m-p/475051#M44085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm following along with &lt;A href="https://developers.arcgis.com/labs/javascript/query-a-feature-layer/"&gt;this &lt;/A&gt;tutorial for Querying a feature layer using the ArcGIS JavaScript API, but using my own layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/445462_pastedImage_6.png" /&gt;&lt;/P&gt;&lt;P&gt;I am trying to query all features within the layer that have a value&amp;nbsp;of 3 in the field called "mag". I'm supposed to get the length of the features in the query result when I console.log. This should not be 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I am getting a result of 0, implying that I didn't get the query correct. What should my query statement &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;query.where&amp;nbsp;=&amp;nbsp;"mag = 3";&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;be changed to here?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN style="color: #569cd6;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;query&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #4ec9b0;"&gt;Query&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;();&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;query&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"mag = 3"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;query&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;outfields&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; = [&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"*"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;];&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;query&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;returnGeometry&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;true&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;queryTask&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #4ec9b0;"&gt;QueryTask&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;({&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;url:&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"https://services5.arcgis.com/.../arcgis/rest/services/datalayer/FeatureServer"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4; font-family: 'courier new', courier, monospace;"&gt; });&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;queryTask&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;execute&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;query&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN style="color: #d4d4d4;"&gt; .&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;result&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;) {&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #4ec9b0;"&gt;console&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;log&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;result&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;features&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4; font-family: 'courier new', courier, monospace;"&gt; })&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN style="color: #d4d4d4;"&gt; .&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;otherwise&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;e&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;) {&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #4ec9b0;"&gt;console&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;log&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;e&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4; font-family: 'courier new', courier, monospace;"&gt; })&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 May 2019 18:56:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-a-feature-layer-doesn-t-work/m-p/475051#M44085</guid>
      <dc:creator>Kevin_C</dc:creator>
      <dc:date>2019-05-01T18:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Querying a Feature Layer doesn't work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-a-feature-layer-doesn-t-work/m-p/475052#M44086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved it. Turns out I was using the url for Feature Service. Not the layer itself. Fixing the url works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 May 2019 19:00:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-a-feature-layer-doesn-t-work/m-p/475052#M44086</guid>
      <dc:creator>Kevin_C</dc:creator>
      <dc:date>2019-05-01T19:00:37Z</dc:date>
    </item>
  </channel>
</rss>

