<?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 Expression works but doesn't display properly in Popup in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-works-but-doesn-t-display/m-p/1604228#M64364</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I'm using an Arcade expression in a popup to display observed bird species counts along with an image for point feature layer. The code runs without errors in the Arcade editor. The image is also loading correctly from the "Image_url" field in pop-up.&amp;nbsp; However, the species count part is not showing up at all. Instead, I only see the fallback message "No Species Data Available"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is the Arcade expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Dictionary to map species codes to full names
var speciesMap = {
    "EABL": "Eastern Bluebird",
    "MOBL": "Mountain Bluebird",
    "WEBL": "Western Bluebird",
    "PABU": "Painted Bunting",
    "AMGO": "American Goldfinch",
    "LEGO": "Lesser Goldfinch",
    "BHNU": "Brown-headed Nuthatch",
    "PYNU": "Pygmy Nuthatch",
    "RBNU": "Red-breasted Nuthatch",
    "WBNU": "White-breasted Nuthatch",
    "EATO": "Eastern Towhee",
    "SPTO": "Spotted Towhee"
};

// // Function to place image to the side of the text
function buildbox(imageURL, txt) {
    return '&amp;lt;figure class="table"&amp;gt;&amp;lt;table&amp;gt;&amp;lt;tbody&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td width=100px;height=100px&amp;gt;&amp;lt;img src="' + imageURL + '" alt="" height=100 width=100 /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td width=20px&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;' + txt + '&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/tbody&amp;gt;&amp;lt;/table&amp;gt;&amp;lt;/figure&amp;gt;';
     
   };

// Initialize an empty list for observed species
var validSpecies = [];

// Iterate through species dictionary
for (var speciesCode in speciesMap) {
    // Safely get value or null if field doesn't exist
    var speciesCount = When(
        IsEmpty($feature[speciesCode]), null,
        $feature[speciesCode]
    );

    if (!IsEmpty(speciesCount)) {
        Push(validSpecies, speciesMap[speciesCode] + ": " + speciesCount);
    }
}


// Format observed species text
var speciesText = Concatenate(validSpecies, TextFormatting.NewLine);

// Get image URL safely
var imgUrl = "";
if (HasKey($feature, "Image_url")) {
    imgUrl = $feature.Image_url;
}

// Debugging output: Check if speciesText is empty
if (IsEmpty(speciesText)) {
    speciesText = "&amp;lt;p style='color:pink;'&amp;gt;No species data available.&amp;lt;/p&amp;gt;";
}

var finalText = buildbox(imgUrl, "&amp;lt;b&amp;gt;Observed Species Count&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;" + speciesText)

return{
    type : 'text',
    text : finalText
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This is the output result which I believe it'correct&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="output_run.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/129793i4AEF0F1D31B56040/image-size/large?v=v2&amp;amp;px=999" role="button" title="output_run.png" alt="output_run.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is the &lt;A href="https://audubon.maps.arcgis.com/apps/mapviewer/index.html?webmap=780664627bcd4440bcfa62683480d08e" target="_blank" rel="noopener"&gt;web map link&lt;/A&gt; which one I am trying to configure the pop-up.&lt;/P&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;Questions:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;OL class=""&gt;&lt;LI&gt;Is there something wrong with how I'm checking for IsEmpty($feature[speciesCode]) using When()?&lt;/LI&gt;&lt;LI&gt;Could the issue be that these fields are not being recognized in Arcade?&lt;/LI&gt;&lt;LI&gt;Is there a better way to dynamically access multiple field values for summary display in a popup?&lt;/LI&gt;&lt;/OL&gt;&lt;DIV class=""&gt;I appreciate any insight or ideas on what might be going wrong here!&lt;/DIV&gt;</description>
    <pubDate>Wed, 09 Apr 2025 15:55:26 GMT</pubDate>
    <dc:creator>ShwarnaBhattacharjee</dc:creator>
    <dc:date>2025-04-09T15:55:26Z</dc:date>
    <item>
      <title>Arcade Expression works but doesn't display properly in Popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-works-but-doesn-t-display/m-p/1604228#M64364</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I'm using an Arcade expression in a popup to display observed bird species counts along with an image for point feature layer. The code runs without errors in the Arcade editor. The image is also loading correctly from the "Image_url" field in pop-up.&amp;nbsp; However, the species count part is not showing up at all. Instead, I only see the fallback message "No Species Data Available"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is the Arcade expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Dictionary to map species codes to full names
var speciesMap = {
    "EABL": "Eastern Bluebird",
    "MOBL": "Mountain Bluebird",
    "WEBL": "Western Bluebird",
    "PABU": "Painted Bunting",
    "AMGO": "American Goldfinch",
    "LEGO": "Lesser Goldfinch",
    "BHNU": "Brown-headed Nuthatch",
    "PYNU": "Pygmy Nuthatch",
    "RBNU": "Red-breasted Nuthatch",
    "WBNU": "White-breasted Nuthatch",
    "EATO": "Eastern Towhee",
    "SPTO": "Spotted Towhee"
};

// // Function to place image to the side of the text
function buildbox(imageURL, txt) {
    return '&amp;lt;figure class="table"&amp;gt;&amp;lt;table&amp;gt;&amp;lt;tbody&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td width=100px;height=100px&amp;gt;&amp;lt;img src="' + imageURL + '" alt="" height=100 width=100 /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td width=20px&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;' + txt + '&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/tbody&amp;gt;&amp;lt;/table&amp;gt;&amp;lt;/figure&amp;gt;';
     
   };

// Initialize an empty list for observed species
var validSpecies = [];

// Iterate through species dictionary
for (var speciesCode in speciesMap) {
    // Safely get value or null if field doesn't exist
    var speciesCount = When(
        IsEmpty($feature[speciesCode]), null,
        $feature[speciesCode]
    );

    if (!IsEmpty(speciesCount)) {
        Push(validSpecies, speciesMap[speciesCode] + ": " + speciesCount);
    }
}


// Format observed species text
var speciesText = Concatenate(validSpecies, TextFormatting.NewLine);

// Get image URL safely
var imgUrl = "";
if (HasKey($feature, "Image_url")) {
    imgUrl = $feature.Image_url;
}

// Debugging output: Check if speciesText is empty
if (IsEmpty(speciesText)) {
    speciesText = "&amp;lt;p style='color:pink;'&amp;gt;No species data available.&amp;lt;/p&amp;gt;";
}

var finalText = buildbox(imgUrl, "&amp;lt;b&amp;gt;Observed Species Count&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;" + speciesText)

return{
    type : 'text',
    text : finalText
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This is the output result which I believe it'correct&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="output_run.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/129793i4AEF0F1D31B56040/image-size/large?v=v2&amp;amp;px=999" role="button" title="output_run.png" alt="output_run.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is the &lt;A href="https://audubon.maps.arcgis.com/apps/mapviewer/index.html?webmap=780664627bcd4440bcfa62683480d08e" target="_blank" rel="noopener"&gt;web map link&lt;/A&gt; which one I am trying to configure the pop-up.&lt;/P&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;Questions:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;OL class=""&gt;&lt;LI&gt;Is there something wrong with how I'm checking for IsEmpty($feature[speciesCode]) using When()?&lt;/LI&gt;&lt;LI&gt;Could the issue be that these fields are not being recognized in Arcade?&lt;/LI&gt;&lt;LI&gt;Is there a better way to dynamically access multiple field values for summary display in a popup?&lt;/LI&gt;&lt;/OL&gt;&lt;DIV class=""&gt;I appreciate any insight or ideas on what might be going wrong here!&lt;/DIV&gt;</description>
      <pubDate>Wed, 09 Apr 2025 15:55:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-works-but-doesn-t-display/m-p/1604228#M64364</guid>
      <dc:creator>ShwarnaBhattacharjee</dc:creator>
      <dc:date>2025-04-09T15:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression works but doesn't display properly in Popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-works-but-doesn-t-display/m-p/1604428#M64372</link>
      <description>&lt;P&gt;I have been able to solve this problem!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Apr 2025 22:21:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-works-but-doesn-t-display/m-p/1604428#M64372</guid>
      <dc:creator>ShwarnaBhattacharjee</dc:creator>
      <dc:date>2025-04-09T22:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression works but doesn't display properly in Popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-works-but-doesn-t-display/m-p/1689719#M68142</link>
      <description>&lt;P&gt;Hello! I'm having a similar problem with if a link is empty don't use field. How did you solve the problem.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 16:49:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-works-but-doesn-t-display/m-p/1689719#M68142</guid>
      <dc:creator>MelissaMitchell</dc:creator>
      <dc:date>2026-03-10T16:49:57Z</dc:date>
    </item>
  </channel>
</rss>

