<?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: Why Won't My Query Count the Related Features? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602667#M56425</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I updated that as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Jun 2015 18:30:15 GMT</pubDate>
    <dc:creator>ChrisSergent</dc:creator>
    <dc:date>2015-06-10T18:30:15Z</dc:date>
    <item>
      <title>Why Won't My Query Count the Related Features?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602658#M56416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to count the related features when the user clicks on a feature, but my query won't run. An example of what I am trying to do in our REST Service directory is the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Where Statement: SUPPORTID='691'&lt;/P&gt;&lt;P&gt;The URL to run the where statement: &lt;A href="http://maps.decaturil.gov/arcgis/rest/services/test/StreetSignTest/FeatureServer/0" title="http://maps.decaturil.gov/arcgis/rest/services/test/StreetSignTest/FeatureServer/0" rel="nofollow noopener noreferrer" target="_blank"&gt;Layer: Sign (ID: 0)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also published app at: &lt;A href="http://geonet.esri.com/" rel="nofollow noopener noreferrer" target="_blank"&gt;maps.decaturil.gov/streetSigns/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;And the latest version is on github at: &lt;A href="https://github.com/csergent45/streetSigns/tree/297fa633f0ebb529862e35b7019c04d7259fbfe8" title="https://github.com/csergent45/streetSigns/tree/297fa633f0ebb529862e35b7019c04d7259fbfe8" rel="nofollow noopener noreferrer" target="_blank"&gt;csergent45/streetSigns at 297fa633f0ebb529862e35b7019c04d7259fbfe8 · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my code, I have entered the following for the code block to run the query and to display a count in the console, but it's not working:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;// url the query task is to be performed on
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var queryTask = new QueryTask(config.signLayerUrl);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var query = esriQuery();


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // count related records
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esriQuery.where = "SUPPORTID =='" + supportId + "'";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // display number of related records in console
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.executeForCount(query,function(count){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(count);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; })&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The supportId is the support ID of the feature that was clicked on.&lt;/P&gt;&lt;P&gt;The config.signLayerUrl is the URL that I am querying.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why doesn't this work? I referenced the API at: &lt;A href="https://developers.arcgis.com/javascript/jsapi/querytask-amd.html#executeforcount" rel="nofollow noopener noreferrer" target="_blank"&gt;https://developers.arcgis.com/javascript/jsapi/querytask-amd.html#executeforcount&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:50:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602658#M56416</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2021-12-12T01:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why Won't My Query Count the Related Features?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602659#M56417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; your SQL sntax should not have equal equal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;esriQuery.where = &lt;SPAN class="string"&gt;"SUPPORTID = '" + supportId + &lt;SPAN class="string"&gt;"'"&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 16:36:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602659#M56417</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-06-10T16:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Why Won't My Query Count the Related Features?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602660#M56418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I updated my code to that, but I still receive the following: {"error":{"code":400,"message":"Unable to complete operation.","details":[]}}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 16:41:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602660#M56418</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2015-06-10T16:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Why Won't My Query Count the Related Features?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602661#M56419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What type of field is &lt;SPAN class="string"&gt;SUPPORTID? If it is a numeric field then your SQL Syntax should look like this instead:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="string"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="string"&gt;esriQuery.where = &lt;SPAN class="string"&gt;"SUPPORTID = " + supportId&lt;SPAN class="string"&gt;&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 16:54:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602661#M56419</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-06-10T16:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why Won't My Query Count the Related Features?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602662#M56420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's an esriInteger, but does not appear to populate the where statement:&lt;/P&gt;&lt;OL class="children expanded" style="list-style-type: none; padding-left: 12px; color: #222222; font-family: 'Segoe UI', Tahoma, sans-serif; font-size: 12px;"&gt;&lt;LI&gt;&lt;SPAN class="header-name" style="color: #545454; margin-right: 0.5em; font-weight: bold;"&gt;f:&lt;/SPAN&gt;&lt;SPAN class="header-value source-code" style="font-family: Consolas, 'Lucida Console', monospace; margin-right: 1em; margin-top: 1px;"&gt;json&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="header-name" style="color: #545454; margin-right: 0.5em; font-weight: bold;"&gt;returnIdsOnly:&lt;/SPAN&gt;&lt;SPAN class="header-value source-code" style="font-family: Consolas, 'Lucida Console', monospace; margin-right: 1em; margin-top: 1px;"&gt;true&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="header-name" style="color: #545454; margin-right: 0.5em; font-weight: bold;"&gt;returnCountOnly:&lt;/SPAN&gt;&lt;SPAN class="header-value source-code" style="font-family: Consolas, 'Lucida Console', monospace; margin-right: 1em; margin-top: 1px;"&gt;true&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="header-name" style="color: #545454; margin-right: 0.5em; font-weight: bold;"&gt;where:&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="header-name" style="color: #545454; margin-right: 0.5em; font-weight: bold;"&gt;returnGeometry:&lt;/SPAN&gt;&lt;SPAN class="header-value source-code" style="font-family: Consolas, 'Lucida Console', monospace; margin-right: 1em; margin-top: 1px;"&gt;false&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="header-name" style="color: #545454; margin-right: 0.5em; font-weight: bold;"&gt;spatialRel:&lt;/SPAN&gt;&lt;SPAN class="header-value source-code" style="font-family: Consolas, 'Lucida Console', monospace; margin-right: 1em; margin-top: 1px;"&gt;esriSpatialRelIntersects&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN class="header-value source-code" style="font-family: Consolas, 'Lucida Console', monospace; margin-right: 1em; margin-top: 1px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="header-value source-code" style="font-family: Consolas, 'Lucida Console', monospace; margin-right: 1em; margin-top: 1px;"&gt;I got this from the network tab.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 16:59:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602662#M56420</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2015-06-10T16:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: Why Won't My Query Count the Related Features?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602663#M56421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you have made a typo error it is not esriQuery.where = &lt;SPAN class="string"&gt;"SUPPORTID =='" + supportId + &lt;SPAN class="string"&gt;"'"&lt;/SPAN&gt;;&amp;nbsp; it should be query.where....&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="string"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 17:07:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602663#M56421</guid>
      <dc:creator>thejuskambi</dc:creator>
      <dc:date>2015-06-10T17:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why Won't My Query Count the Related Features?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602664#M56422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thejus I was focusing on the SQL statement and missed that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 17:09:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602664#M56422</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-06-10T17:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why Won't My Query Count the Related Features?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602665#M56423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;also you may want to use query = &lt;STRONG&gt;new &lt;/STRONG&gt;esriQuery(); &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 17:11:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602665#M56423</guid>
      <dc:creator>thejuskambi</dc:creator>
      <dc:date>2015-06-10T17:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Why Won't My Query Count the Related Features?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602666#M56424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That did it. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 18:29:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602666#M56424</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2015-06-10T18:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Why Won't My Query Count the Related Features?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602667#M56425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I updated that as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 18:30:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-won-t-my-query-count-the-related-features/m-p/602667#M56425</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2015-06-10T18:30:15Z</dc:date>
    </item>
  </channel>
</rss>

