<?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 Arcade not displaying in popup in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-not-displaying-in-popup/m-p/1198668#M47209</link>
    <description>&lt;P&gt;I have two expressions that are essentially the same and both are functional when testing them but when loading them into the popup only exp0 loads.&lt;/P&gt;&lt;P&gt;Here is the expression, less the ID.&amp;nbsp; The console expression does work and loads the correct number.&amp;nbsp; You'll see from the picture the line is there for the popup but nothing is displaying.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// Create a 2 mile buffer around the selected event
var buff = BufferGeodetic($feature, 2, 'miles')

// Return Retail Stores within 2 miles of what's selected
var portal = Portal("https://www.arcgis.com")
var nrstoreLocations = FeatureSetByPortalItem(portal,"REMOVED_ID", 0, ['Asset_Type'])
var nearbyNRStores = Intersects(nrstoreLocations, buff)

var nrStores = []

//console(count(nrstoreLocations))


for(var f in nearbyNRStores){
    var distance = DistanceGeodetic(f, $feature, "miles")
    var nrstore_distance = Dictionary("NRStoreName",f.Asset_Type,"Distance",distance)
    nrStores[Count(rSTores)] = nrstore_distance 

}

//console(count(rStores))

function compareDistance(a,b){
  if(a['Distance']&amp;lt;b['Distance'])
    return -1;
  if(a['Distance']&amp;gt;b['Distance'])
    return 1;
  return 0;
}

// Build the pop-up string
var popup = ''
nrStores = Sort(nrStores, compareDistance)
for(var nrStore in nrStores){
    popup += nrStores[nrStore].NRStoreName + ": " + ROUND(nrStores[nrStore].Distance, 1) + "mi" +
        TextFormatting.NewLine
}

//return pop-up string
When(Count(nrStores) == 0, TextFormatting.NewLine + TextFormatting.NewLine +
        "No NonRetail within 2 miles of event",

    Count(nrStores) == 1, TextFormatting.NewLine + TextFormatting.NewLine +
        "1 NonRetail within 2 miles of event" + TextFormatting.NewLine
        + popup,
    
    TextFormatting.NewLine + TextFormatting.NewLine +
        Count(nrStores) + " NonRetail within 2 miles of event" + TextFormatting.NewLine
        + popup)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SpatialSean_2-1659463732053.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/47617i1F7B58FEAA9D1B62/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SpatialSean_2-1659463732053.png" alt="SpatialSean_2-1659463732053.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SpatialSean_1-1659463666717.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/47616i475C2DB83D00CEB0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SpatialSean_1-1659463666717.png" alt="SpatialSean_1-1659463666717.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Aug 2022 18:10:02 GMT</pubDate>
    <dc:creator>SpatialSean</dc:creator>
    <dc:date>2022-08-02T18:10:02Z</dc:date>
    <item>
      <title>Arcade not displaying in popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-not-displaying-in-popup/m-p/1198668#M47209</link>
      <description>&lt;P&gt;I have two expressions that are essentially the same and both are functional when testing them but when loading them into the popup only exp0 loads.&lt;/P&gt;&lt;P&gt;Here is the expression, less the ID.&amp;nbsp; The console expression does work and loads the correct number.&amp;nbsp; You'll see from the picture the line is there for the popup but nothing is displaying.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// Create a 2 mile buffer around the selected event
var buff = BufferGeodetic($feature, 2, 'miles')

// Return Retail Stores within 2 miles of what's selected
var portal = Portal("https://www.arcgis.com")
var nrstoreLocations = FeatureSetByPortalItem(portal,"REMOVED_ID", 0, ['Asset_Type'])
var nearbyNRStores = Intersects(nrstoreLocations, buff)

var nrStores = []

//console(count(nrstoreLocations))


for(var f in nearbyNRStores){
    var distance = DistanceGeodetic(f, $feature, "miles")
    var nrstore_distance = Dictionary("NRStoreName",f.Asset_Type,"Distance",distance)
    nrStores[Count(rSTores)] = nrstore_distance 

}

//console(count(rStores))

function compareDistance(a,b){
  if(a['Distance']&amp;lt;b['Distance'])
    return -1;
  if(a['Distance']&amp;gt;b['Distance'])
    return 1;
  return 0;
}

// Build the pop-up string
var popup = ''
nrStores = Sort(nrStores, compareDistance)
for(var nrStore in nrStores){
    popup += nrStores[nrStore].NRStoreName + ": " + ROUND(nrStores[nrStore].Distance, 1) + "mi" +
        TextFormatting.NewLine
}

//return pop-up string
When(Count(nrStores) == 0, TextFormatting.NewLine + TextFormatting.NewLine +
        "No NonRetail within 2 miles of event",

    Count(nrStores) == 1, TextFormatting.NewLine + TextFormatting.NewLine +
        "1 NonRetail within 2 miles of event" + TextFormatting.NewLine
        + popup,
    
    TextFormatting.NewLine + TextFormatting.NewLine +
        Count(nrStores) + " NonRetail within 2 miles of event" + TextFormatting.NewLine
        + popup)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SpatialSean_2-1659463732053.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/47617i1F7B58FEAA9D1B62/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SpatialSean_2-1659463732053.png" alt="SpatialSean_2-1659463732053.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SpatialSean_1-1659463666717.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/47616i475C2DB83D00CEB0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SpatialSean_1-1659463666717.png" alt="SpatialSean_1-1659463666717.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 18:10:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-not-displaying-in-popup/m-p/1198668#M47209</guid>
      <dc:creator>SpatialSean</dc:creator>
      <dc:date>2022-08-02T18:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade not displaying in popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-not-displaying-in-popup/m-p/1198824#M47220</link>
      <description>&lt;P&gt;In lines 17 and 21, you're using &lt;STRONG&gt;rStores&lt;/STRONG&gt; instead of &lt;STRONG&gt;nrStores&lt;/STRONG&gt;, that might be it...&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 05:31:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-not-displaying-in-popup/m-p/1198824#M47220</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-08-03T05:31:22Z</dc:date>
    </item>
  </channel>
</rss>

