<?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: Executing multiple queryTasks with a relationshipTask in the middle in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/executing-multiple-querytasks-with-a/m-p/432300#M39833</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I hobe i understand it right you want to do a query. With the Results of the query you want to call a second and with the second a third?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;function callquery1(params) { &amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask = new esri.tasks.QueryTask(queryurl); &amp;nbsp;&amp;nbsp;&amp;nbsp; query = new esri.tasks.Query(); &amp;nbsp;&amp;nbsp;&amp;nbsp; query.returnGeometry = true; &amp;nbsp;&amp;nbsp;&amp;nbsp; query.outFields = ["*"];&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; query.where = "id = '" + params+ "'"; &amp;nbsp;&amp;nbsp;&amp;nbsp; //either &amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.execute(query,function(results){ &amp;nbsp; here create your second query&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }); &amp;nbsp;&amp;nbsp;&amp;nbsp; //or &amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.execute(query,callquery2); } function callquery2(results) { &amp;nbsp;&amp;nbsp;&amp;nbsp; //with the results you bild you second params &amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(results); //write the results to the console check firebug or dom inspektor &amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask = new esri.tasks.QueryTask(queryurl); &amp;nbsp;&amp;nbsp;&amp;nbsp; query = new esri.tasks.Query(); &amp;nbsp;&amp;nbsp;&amp;nbsp; query.returnGeometry = true; &amp;nbsp;&amp;nbsp;&amp;nbsp; query.outFields = ["*"];&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; query.where = "id = '" + params+ "'"; &amp;nbsp;&amp;nbsp;&amp;nbsp; //either &amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.execute(query,function(results){ &amp;nbsp; here create your thirdquery&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }); &amp;nbsp;&amp;nbsp;&amp;nbsp; //or &amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.execute(query,callquery3); } &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope it helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; and i hope i understand waht you want to do &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Nov 2012 11:23:31 GMT</pubDate>
    <dc:creator>JanJeske</dc:creator>
    <dc:date>2012-11-29T11:23:31Z</dc:date>
    <item>
      <title>Executing multiple queryTasks with a relationshipTask in the middle</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/executing-multiple-querytasks-with-a/m-p/432299#M39832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to execute multiple query tasks, where the second queryTask depends on a relationshipTask result from a featureLayer after the first queryTask. It'll look something like this&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;queryTask1()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; relationshipTask(necessary input from queryTask1 result)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;queryTask2(necessary input from relationshipTask within queryTask1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried using the ESRI example, &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/query_deferred_list.html" rel="nofollow" target="_blank"&gt;"Multiple query results with deferred list"&lt;/A&gt;&lt;SPAN&gt;, but I cannot figure out how to do it the way that works for me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm querying a view within the first queryTask to retrieve objectids and an integer, then I'm using a relationshipQuery with the objectids to retrieve a list of strings. I'm using the list of strings to query a 3rd view within the second queryTask to display the results in a dojo table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is using a deferredList the way to go? If so, could somebody please provide an example of how to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2012 17:43:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/executing-multiple-querytasks-with-a/m-p/432299#M39832</guid>
      <dc:creator>AndrewBrown1</dc:creator>
      <dc:date>2012-11-28T17:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Executing multiple queryTasks with a relationshipTask in the middle</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/executing-multiple-querytasks-with-a/m-p/432300#M39833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I hobe i understand it right you want to do a query. With the Results of the query you want to call a second and with the second a third?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;function callquery1(params) { &amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask = new esri.tasks.QueryTask(queryurl); &amp;nbsp;&amp;nbsp;&amp;nbsp; query = new esri.tasks.Query(); &amp;nbsp;&amp;nbsp;&amp;nbsp; query.returnGeometry = true; &amp;nbsp;&amp;nbsp;&amp;nbsp; query.outFields = ["*"];&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; query.where = "id = '" + params+ "'"; &amp;nbsp;&amp;nbsp;&amp;nbsp; //either &amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.execute(query,function(results){ &amp;nbsp; here create your second query&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }); &amp;nbsp;&amp;nbsp;&amp;nbsp; //or &amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.execute(query,callquery2); } function callquery2(results) { &amp;nbsp;&amp;nbsp;&amp;nbsp; //with the results you bild you second params &amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(results); //write the results to the console check firebug or dom inspektor &amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask = new esri.tasks.QueryTask(queryurl); &amp;nbsp;&amp;nbsp;&amp;nbsp; query = new esri.tasks.Query(); &amp;nbsp;&amp;nbsp;&amp;nbsp; query.returnGeometry = true; &amp;nbsp;&amp;nbsp;&amp;nbsp; query.outFields = ["*"];&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; query.where = "id = '" + params+ "'"; &amp;nbsp;&amp;nbsp;&amp;nbsp; //either &amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.execute(query,function(results){ &amp;nbsp; here create your thirdquery&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }); &amp;nbsp;&amp;nbsp;&amp;nbsp; //or &amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.execute(query,callquery3); } &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope it helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; and i hope i understand waht you want to do &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2012 11:23:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/executing-multiple-querytasks-with-a/m-p/432300#M39833</guid>
      <dc:creator>JanJeske</dc:creator>
      <dc:date>2012-11-29T11:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: Executing multiple queryTasks with a relationshipTask in the middle</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/executing-multiple-querytasks-with-a/m-p/432301#M39834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was able to solve my issue. I removed the relationshipQuery and nested the queryTasks so they'll fire in the correct order, which worked perfectly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks anyhow!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2012 12:50:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/executing-multiple-querytasks-with-a/m-p/432301#M39834</guid>
      <dc:creator>AndrewBrown1</dc:creator>
      <dc:date>2012-11-29T12:50:10Z</dc:date>
    </item>
  </channel>
</rss>

