<?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: Is there a way to execute a QueryTask synchronously? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-there-a-way-to-execute-a-querytask/m-p/106225#M9811</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are just using the REST API directly then a &lt;A href="http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Query_Feature_Service/02r3000000w5000000/"&gt;FeatureServer/query&lt;/A&gt; is the way to go to query multiple layers in a single request - note that this is still an asynchronous request. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using the JavaScript API then you can group multiple QueryTasks into a DefferedList and process the results when all queries are completed. From your code it appears as though you are responding to a single request even though multiple server requests are sent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should look into Dojo DefferedLists as a way to combine the results of multiple query tasks. More information on them is available on this page - &lt;A href="http://davidwalsh.name/deferredlist" title="http://davidwalsh.name/deferredlist"&gt;http://davidwalsh.name/deferredlist&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Feb 2015 10:36:57 GMT</pubDate>
    <dc:creator>OwenEarley</dc:creator>
    <dc:date>2015-02-11T10:36:57Z</dc:date>
    <item>
      <title>Is there a way to execute a QueryTask synchronously?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-there-a-way-to-execute-a-querytask/m-p/106224#M9810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to query a REST Service for the underlying Points/Polylines/Polygons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ie. ../FeatureServer/0/query, ../FeatureServer/1/query and ../FeatureServer/2/query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of nesting all the callbacks into each other I am trying to find a way to execute each query synchronously so that I can group the results in one array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also noticed there is a ../FeatureServer/query service that enables to query all the 3 underlying layers together but can this be achieved through the Javascript API Objects? A jquery synchronous ajax call would suffice but I would like to achieve this the proper way through the API.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Brian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 08:57:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-there-a-way-to-execute-a-querytask/m-p/106224#M9810</guid>
      <dc:creator>BrianCachia</dc:creator>
      <dc:date>2015-02-11T08:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to execute a QueryTask synchronously?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-there-a-way-to-execute-a-querytask/m-p/106225#M9811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are just using the REST API directly then a &lt;A href="http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Query_Feature_Service/02r3000000w5000000/"&gt;FeatureServer/query&lt;/A&gt; is the way to go to query multiple layers in a single request - note that this is still an asynchronous request. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using the JavaScript API then you can group multiple QueryTasks into a DefferedList and process the results when all queries are completed. From your code it appears as though you are responding to a single request even though multiple server requests are sent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should look into Dojo DefferedLists as a way to combine the results of multiple query tasks. More information on them is available on this page - &lt;A href="http://davidwalsh.name/deferredlist" title="http://davidwalsh.name/deferredlist"&gt;http://davidwalsh.name/deferredlist&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 10:36:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-there-a-way-to-execute-a-querytask/m-p/106225#M9811</guid>
      <dc:creator>OwenEarley</dc:creator>
      <dc:date>2015-02-11T10:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to execute a QueryTask synchronously?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-there-a-way-to-execute-a-querytask/m-p/106226#M9812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the help, i ll definitely look into the DefferedList.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 10:53:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-there-a-way-to-execute-a-querytask/m-p/106226#M9812</guid>
      <dc:creator>BrianCachia</dc:creator>
      <dc:date>2015-02-11T10:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to execute a QueryTask synchronously?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-there-a-way-to-execute-a-querytask/m-p/106227#M9813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, check out this post that uses the newer version of dojo promise lists:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/118001"&gt;Need help converting a DeferredList to use dojo/promise/all&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 11:21:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-there-a-way-to-execute-a-querytask/m-p/106227#M9813</guid>
      <dc:creator>OwenEarley</dc:creator>
      <dc:date>2015-02-11T11:21:22Z</dc:date>
    </item>
  </channel>
</rss>

