<?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: Arcade Expression Not Returning Anything in Pop-up in Some Scenarios. in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-not-returning-anything-in-pop-up/m-p/1654203#M66476</link>
    <description>&lt;P&gt;Thank you, this fixed the issue! Thanks for catching the problem and for the solution!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Sep 2025 15:06:54 GMT</pubDate>
    <dc:creator>MollyMoore</dc:creator>
    <dc:date>2025-09-30T15:06:54Z</dc:date>
    <item>
      <title>Arcade Expression Not Returning Anything in Pop-up in Some Scenarios.</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-not-returning-anything-in-pop-up/m-p/1653925#M66464</link>
      <description>&lt;P&gt;I am using an Arcade expression with HTML to format a feature layer pop-up in a web map. The format looks great, but for several features, the pop-up is just blank - without even the heading attributes that are populated for all features. In some cases, the features do not have related records and/or images - I thought I accounted for that with if statements. I think this issue seems to be occurring when there are no related site account records. Can anyone see anything wrong with the code that would be making this occur?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// first get heading with attributes from selected feature
var output = "&amp;lt;p line-height: 1.6;&amp;gt;&amp;lt;span style='font-size:2em;'&amp;gt;&amp;lt;strong&amp;gt;"+$feature.site_name+" NHA&amp;lt;/strong&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;"
output += "&amp;lt;span style='font-size:1.5em;'&amp;gt;A site of "+$feature.sig_rank+" significance.&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;"

// this is pulling in the attachment and displaying
var attach = Attachments($feature)
if(Count(attach) != 0) {
  var Part1 = "https://services2.arcgis.com/REST SERVICE URL"
  var ObjectID = $feature.OBJECTID
  var Part2 = "/attachments/"
  var AttachID = First(attach).ID
  var img_path = Part1 + ObjectID + Part2 + AttachID
  var img_caption = $feature.photo_caption
  output += "&amp;lt;p&amp;gt;&amp;lt;img src="+img_path+"&amp;gt;&amp;lt;br&amp;gt;"+img_caption+"&amp;lt;/p&amp;gt;"
}

// get site description and tr summary
var related_site = FeatureSetByRelationshipName($feature, "Site_Accounts", ["site_desc","tr_summary"]);

if (!IsEmpty(related_site)) {
    var firstRel = First(related_site);
    var desc = firstRel["site_desc"];
    output += "&amp;lt;p&amp;gt;&amp;lt;span style='font-size:1em;'&amp;gt;"+desc+"&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;"
    var tr_summ = firstRel["tr_summary"]
    if(!IsEmpty(tr_summ)) {
      output += "&amp;lt;p&amp;gt;&amp;lt;span style='font-size:1.2em;'&amp;gt;&amp;lt;strong&amp;gt;Threats and Recommendations&amp;lt;/strong&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;"
      output += "&amp;lt;span style='font-size:1em;'&amp;gt;"+tr_summ+"&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;"
    }
}

// Get the related features
var relatedRecords = FeatureSetByRelationshipName($feature, "Threats_and_Recommendation_Bullets", ["threat_text"]);

// Check if any related records exist
if (Count(relatedRecords) &amp;gt; 0) {
  // Start an HTML unordered list
  output += "&amp;lt;span style='font-size:1.0em;'&amp;gt;Specific threats and stresses to the elements present at this site, as well as conservation actions, include:&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;ul&amp;gt;";

  // Loop through each related record
  for (var record in relatedRecords) {
    // Add a list item with the attributes you want to display
    output += "&amp;lt;li&amp;gt;" + record.threat_text + "&amp;lt;/li&amp;gt;";
  }
  output+= "&amp;lt;/ul&amp;gt;"
}

return {
	type : 'text', 
	text : output //this property supports html tags 
};&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 29 Sep 2025 17:18:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-not-returning-anything-in-pop-up/m-p/1653925#M66464</guid>
      <dc:creator>MollyMoore</dc:creator>
      <dc:date>2025-09-29T17:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression Not Returning Anything in Pop-up in Some Scenarios.</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-not-returning-anything-in-pop-up/m-p/1654186#M66474</link>
      <description>&lt;P&gt;Lines 20 tests whether a relationship exists, not whether there are records in the relationship. The code fails when you try to access a field from a null in line 22&lt;/P&gt;&lt;P&gt;You'll have to test whether that relationship has any records.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if (Count(related_site) &amp;gt; 0) {&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Sep 2025 14:43:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-not-returning-anything-in-pop-up/m-p/1654186#M66474</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-09-30T14:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression Not Returning Anything in Pop-up in Some Scenarios.</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-not-returning-anything-in-pop-up/m-p/1654203#M66476</link>
      <description>&lt;P&gt;Thank you, this fixed the issue! Thanks for catching the problem and for the solution!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Sep 2025 15:06:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-not-returning-anything-in-pop-up/m-p/1654203#M66476</guid>
      <dc:creator>MollyMoore</dc:creator>
      <dc:date>2025-09-30T15:06:54Z</dc:date>
    </item>
  </channel>
</rss>

