<?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 Help making Popup Template load synchronously or delay it. in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-making-popup-template-load-synchronously-or/m-p/205878#M19123</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to delay or make the popup template load synchronously? Currently when I click on a feature on my map, the template loads as expected. In my customLandPopup, there is an Arcade expression that I am using to populate one of my fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;var myLayers = new MapImageLayer({
    url: 'https:sample/MapServer/',
    sublayers: [
        {
            id: 5,
            visible: true,
            title: 'Land',
            popupTemplate: customLandPopup
        },‍‍‍‍‍‍‍‍
    ]
});‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the very first click (#1) to query, let's say it returned 5 features. In the popup for the first feature, the expression will throw an error, and there will be a blank in the table:&amp;nbsp;&lt;/P&gt;&lt;P&gt;[esri.widgets.FeatureViewModel] query-required-fields Could not query required fields for the specified layer. Some fields will not be available.&lt;/P&gt;&lt;P&gt;[esri.widgets.FeatureViewModel] arcade-execution-error TypeError: Cannot read property 'length' of undefined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the subsequent 4 features, that same field will be correctly populated from the arcade expression. Is it possible that this is due to an asynchronous loading of the features while the popup is being opened?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any advice on this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 10:11:31 GMT</pubDate>
    <dc:creator>AshleyOng</dc:creator>
    <dc:date>2021-12-11T10:11:31Z</dc:date>
    <item>
      <title>Help making Popup Template load synchronously or delay it.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-making-popup-template-load-synchronously-or/m-p/205878#M19123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to delay or make the popup template load synchronously? Currently when I click on a feature on my map, the template loads as expected. In my customLandPopup, there is an Arcade expression that I am using to populate one of my fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;var myLayers = new MapImageLayer({
    url: 'https:sample/MapServer/',
    sublayers: [
        {
            id: 5,
            visible: true,
            title: 'Land',
            popupTemplate: customLandPopup
        },‍‍‍‍‍‍‍‍
    ]
});‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the very first click (#1) to query, let's say it returned 5 features. In the popup for the first feature, the expression will throw an error, and there will be a blank in the table:&amp;nbsp;&lt;/P&gt;&lt;P&gt;[esri.widgets.FeatureViewModel] query-required-fields Could not query required fields for the specified layer. Some fields will not be available.&lt;/P&gt;&lt;P&gt;[esri.widgets.FeatureViewModel] arcade-execution-error TypeError: Cannot read property 'length' of undefined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the subsequent 4 features, that same field will be correctly populated from the arcade expression. Is it possible that this is due to an asynchronous loading of the features while the popup is being opened?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any advice on this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:11:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-making-popup-template-load-synchronously-or/m-p/205878#M19123</guid>
      <dc:creator>AshleyOng</dc:creator>
      <dc:date>2021-12-11T10:11:31Z</dc:date>
    </item>
  </channel>
</rss>

