<?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: JS ArcGIS API question in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-arcgis-api-question/m-p/226321#M21127</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Meghan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;That is expected. The code following the .then is inline code that does not wait for the promise to resolve. So if you have code that is dependent on the request result then it has to inside the .then function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Apr 2020 16:09:34 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2020-04-12T16:09:34Z</dc:date>
    <item>
      <title>JS ArcGIS API question</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-arcgis-api-question/m-p/226320#M21126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one issue in code which I could not figure out. I'm making esriRequest function. Code details:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var req = EsriRequest({ url: lyrIdUrl, content: { f: "json" }, handleAs: "json", callbackParamName: "" },&lt;BR /&gt; { usePost: true });&lt;BR /&gt; req.then(function (response) {&lt;BR /&gt; debugger;&lt;BR /&gt; geotypeJson = response;&lt;BR /&gt; alert("Succeess");&lt;BR /&gt; }, function (error) {&lt;BR /&gt; console.log(error.message);&lt;BR /&gt; alert("ID Error");&lt;BR /&gt; });&lt;BR /&gt; debugger;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For some reason code followed by req.then executes first before what's code inside req.then (I added debugger to confirm this). Can someone help me understand why? Also, can someone help me fix it, please? I want to assign geotypeJson to response from&amp;nbsp;&lt;SPAN&gt;lyrIdUrl.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Meghan Kulkarni#&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Apr 2020 03:18:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-arcgis-api-question/m-p/226320#M21126</guid>
      <dc:creator>MeghanKulkarni</dc:creator>
      <dc:date>2020-04-12T03:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: JS ArcGIS API question</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-arcgis-api-question/m-p/226321#M21127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Meghan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;That is expected. The code following the .then is inline code that does not wait for the promise to resolve. So if you have code that is dependent on the request result then it has to inside the .then function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Apr 2020 16:09:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-arcgis-api-question/m-p/226321#M21127</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-04-12T16:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: JS ArcGIS API question</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-arcgis-api-question/m-p/226322#M21128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Robert. Isn't my code in then function already?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;req.then(&lt;STRONG&gt;function (response) {&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;STRONG style="background-color: #ffffff; "&gt;debugger;&lt;/STRONG&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;STRONG style="background-color: #ffffff; "&gt;geotypeJson = response;&lt;/STRONG&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;alert("Succeess");&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;}, function (error) {&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;console.log(error.message);&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;alert("ID Error");&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;});&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2020 13:49:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-arcgis-api-question/m-p/226322#M21128</guid>
      <dc:creator>MeghanKulkarni</dc:creator>
      <dc:date>2020-04-13T13:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: JS ArcGIS API question</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-arcgis-api-question/m-p/226323#M21129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Meghan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; So I am not sure what's the question you have then.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will always get to the debugger statemkent outside the .then function before you get to inside the debugger (as I mentioned earlier).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2020 14:12:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-arcgis-api-question/m-p/226323#M21129</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-04-13T14:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: JS ArcGIS API question</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-arcgis-api-question/m-p/226324#M21130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically I want to assign&amp;nbsp;&lt;STRONG style="background-color: #ffffff; border: 0px; font-weight: bold;"&gt;geotypeJson = response; &lt;/STRONG&gt;as a consequence of esriRequest execution complete.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2020 14:22:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-arcgis-api-question/m-p/226324#M21130</guid>
      <dc:creator>MeghanKulkarni</dc:creator>
      <dc:date>2020-04-13T14:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: JS ArcGIS API question</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-arcgis-api-question/m-p/226325#M21131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then you need to have anything that uses geoTypeJson wait for the .then to complete or have anything that uses it inside the .then.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2020 14:26:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-arcgis-api-question/m-p/226325#M21131</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-04-13T14:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: JS ArcGIS API question</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-arcgis-api-question/m-p/226326#M21132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let me ask you in a bit of a different way. Is there a way to make esriRequest synchronous from default asynchronous?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Meghan Kulkarni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2020 18:10:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-arcgis-api-question/m-p/226326#M21132</guid>
      <dc:creator>MeghanKulkarni</dc:creator>
      <dc:date>2020-04-13T18:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: JS ArcGIS API question</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-arcgis-api-question/m-p/226327#M21133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nevermind. I found solution in the thread&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/190913-making-request-synchronous"&gt;https://community.esri.com/thread/190913-making-request-synchronous&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2020 18:25:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-arcgis-api-question/m-p/226327#M21133</guid>
      <dc:creator>MeghanKulkarni</dc:creator>
      <dc:date>2020-04-13T18:25:30Z</dc:date>
    </item>
  </channel>
</rss>

