<?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: MapViewer pop-ups not loading in field values if field is referenced using a variable - browser loading issue? in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/arcade-mapviewer-pop-ups-not-loading-in-field/m-p/1700231#M23243</link>
    <description>&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have determined that my original assumptions that functions were causing this issue was incorrect. I have added updated info at the bottom of the post.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;On the left-hand side is the pop-up in the Map Widget. On the right-hand side is the Feature Info widget, showing the pop-up as expected. All of the missing data/styling on the map widget pop-up was generated by functions within Arcade (in the pop-up in MapViewer), which is why I suspect them to be the culprit.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TaraHaynes_1-1778012605225.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/152030i17B8D0A7AD46767F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TaraHaynes_1-1778012605225.png" alt="TaraHaynes_1-1778012605225.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is an example of one of my functions:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function label (status) {
	if (status == "No Survey Data") {
		return "Not Surveyed"
	}
	else if (status == "No Nest Assessment Data") {
		return "Not Surveyed"
	}
	else if (status == "NA") {
		return "N/A"
	}
	else if (Find("Unknown",status,0) &amp;gt; 0) {
		return "Unknown"
	}
	else {
		return status
	}

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is how I am bringing these values into the HTML:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var nest_row=`&amp;lt;tr&amp;gt;&amp;lt;td style="padding:2px;"&amp;gt;&amp;lt;b&amp;gt;${yr}&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td style="padding:3px;border-left:5px solid ${bgcolor($feature[nestfield_name])}"&amp;gt;&amp;lt;i&amp;gt;Discovered&amp;lt;/i&amp;gt; - ${label($feature[nestfield_name])}&amp;lt;/td&amp;gt;&amp;lt;td style="padding:3px;border-left:5px solid ${bgcolor($feature[occfield_name])}"&amp;gt;${label($feature[occfield_name])}&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;`&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When I reference a field using a variable, as below, the value will not show up in the MapViewer pop-up:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fldname = "NestStatus_2016" 
return $feature[nestfield_name]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if the field name is called directly, as below, the value appears in the pop-up:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return $feature.NestStatus_2016&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I reference the field directly at all in the script, even as a variable that doesn't get used, it will &lt;EM&gt;then&lt;/EM&gt;&amp;nbsp;show up in the pop-up where $feature[nestfield_name] is used. Which is to say that I have a workaround and my pop-up is functional, but I have to list every field I want to reference so that it can show up (this is a simplified version of what my script is doing):&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// referencing list of fields i need directly
var flds = [$feature.NestStatus_2024,$feature.NestStatus_2025,$feature.NestStatus_2026]

// calculating # of years between today and the year of nest detection
var yrs = Year(Now()) - $feature.Year_Detected
year_range = Array(yrs)
tbl_rows = ``

for (n in array) {
  yr = $feature.Year_Detected+n
  fld = `NestStatus_${yr}`
  tbl_rows = `&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;yr&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;$feature[fld]&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;`+tbl_rows
}

return tbl_rows&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that 'year' fields are not great data management, and I hope to improve that in the future, but I suppose this is what I'm dealing with for now. Either way, this seems like it could be some kind of bug related to how the browser is loading pop-ups... interested to know if anyone else has run into this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 May 2026 21:06:54 GMT</pubDate>
    <dc:creator>TaraHaynes</dc:creator>
    <dc:date>2026-05-08T21:06:54Z</dc:date>
    <item>
      <title>Arcade: MapViewer pop-ups not loading in field values if field is referenced using a variable - browser loading issue?</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/arcade-mapviewer-pop-ups-not-loading-in-field/m-p/1700231#M23243</link>
      <description>&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have determined that my original assumptions that functions were causing this issue was incorrect. I have added updated info at the bottom of the post.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;On the left-hand side is the pop-up in the Map Widget. On the right-hand side is the Feature Info widget, showing the pop-up as expected. All of the missing data/styling on the map widget pop-up was generated by functions within Arcade (in the pop-up in MapViewer), which is why I suspect them to be the culprit.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TaraHaynes_1-1778012605225.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/152030i17B8D0A7AD46767F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TaraHaynes_1-1778012605225.png" alt="TaraHaynes_1-1778012605225.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is an example of one of my functions:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function label (status) {
	if (status == "No Survey Data") {
		return "Not Surveyed"
	}
	else if (status == "No Nest Assessment Data") {
		return "Not Surveyed"
	}
	else if (status == "NA") {
		return "N/A"
	}
	else if (Find("Unknown",status,0) &amp;gt; 0) {
		return "Unknown"
	}
	else {
		return status
	}

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is how I am bringing these values into the HTML:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var nest_row=`&amp;lt;tr&amp;gt;&amp;lt;td style="padding:2px;"&amp;gt;&amp;lt;b&amp;gt;${yr}&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td style="padding:3px;border-left:5px solid ${bgcolor($feature[nestfield_name])}"&amp;gt;&amp;lt;i&amp;gt;Discovered&amp;lt;/i&amp;gt; - ${label($feature[nestfield_name])}&amp;lt;/td&amp;gt;&amp;lt;td style="padding:3px;border-left:5px solid ${bgcolor($feature[occfield_name])}"&amp;gt;${label($feature[occfield_name])}&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;`&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When I reference a field using a variable, as below, the value will not show up in the MapViewer pop-up:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fldname = "NestStatus_2016" 
return $feature[nestfield_name]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if the field name is called directly, as below, the value appears in the pop-up:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return $feature.NestStatus_2016&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I reference the field directly at all in the script, even as a variable that doesn't get used, it will &lt;EM&gt;then&lt;/EM&gt;&amp;nbsp;show up in the pop-up where $feature[nestfield_name] is used. Which is to say that I have a workaround and my pop-up is functional, but I have to list every field I want to reference so that it can show up (this is a simplified version of what my script is doing):&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// referencing list of fields i need directly
var flds = [$feature.NestStatus_2024,$feature.NestStatus_2025,$feature.NestStatus_2026]

// calculating # of years between today and the year of nest detection
var yrs = Year(Now()) - $feature.Year_Detected
year_range = Array(yrs)
tbl_rows = ``

for (n in array) {
  yr = $feature.Year_Detected+n
  fld = `NestStatus_${yr}`
  tbl_rows = `&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;yr&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;$feature[fld]&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;`+tbl_rows
}

return tbl_rows&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that 'year' fields are not great data management, and I hope to improve that in the future, but I suppose this is what I'm dealing with for now. Either way, this seems like it could be some kind of bug related to how the browser is loading pop-ups... interested to know if anyone else has run into this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2026 21:06:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/arcade-mapviewer-pop-ups-not-loading-in-field/m-p/1700231#M23243</guid>
      <dc:creator>TaraHaynes</dc:creator>
      <dc:date>2026-05-08T21:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade outputs from Functions not displaying in Map Widget pop-up</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/arcade-mapviewer-pop-ups-not-loading-in-field/m-p/1700240#M23245</link>
      <description>&lt;P&gt;I can't imagine why this would be the case based solely on your provided code, but I notice that you do have at least one variable (bgcolor) you haven't shown so I suppose I'll ask: Are you sure they're not showing up? Might they be white text on white background somehow? There's a setting in the feature info widget that can override some popup arcade, so perhaps it's doing that which is why it looks black in the feature info widget?&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 21:01:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/arcade-mapviewer-pop-ups-not-loading-in-field/m-p/1700240#M23245</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2026-05-05T21:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade outputs from Functions not displaying in Map Widget pop-up</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/arcade-mapviewer-pop-ups-not-loading-in-field/m-p/1700357#M23252</link>
      <description>&lt;P&gt;There is no text at all, I did double-check whether it had turned white. To that end, there is other text in the pop-up (not generated by functions) which appears as expected in the Map Widget pop-up and is black. I have my 'Theme' text in ExperienceBuilder set to black.&lt;/P&gt;&lt;P&gt;Bgcolor changes the colour to the left of the Status and Occupancy value - you'll notice that it's all grey in the left-hand pop-up (Map Widget), while yellow is appearing properly in the right-hand pop-up (Feature Info Widget), which indicates that that function isn't working either in the Map Widget pop-up.&lt;/P&gt;&lt;P&gt;For posterity, here is the bgcolor function:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function bgcolor (status) {
	if (status == "NA" || status == "No Survey Data" || status == "No Nest Assessment Data") {
		return `#e3e3e3`
	}

	else if (status == "Not Detected" || status == "Inactive" || status == "Destroyed") {
		return `#FFD899`
	}

	else if (status == "Resident" || status == "Breeding" || status == "Active") {
		return `#639C5F`
	}

	else {
		return `#e3e3e3`
	}
	
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2026 15:05:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/arcade-mapviewer-pop-ups-not-loading-in-field/m-p/1700357#M23252</guid>
      <dc:creator>TaraHaynes</dc:creator>
      <dc:date>2026-05-06T15:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade outputs from Functions not displaying in Map Widget pop-up</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/arcade-mapviewer-pop-ups-not-loading-in-field/m-p/1700360#M23253</link>
      <description>&lt;P&gt;Are you willing/able to share maps and or data? I'd be curious to look at the whole thing and see if I can reproduce that error. If you are, feel free to send me a private message to coordinate that.&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2026 15:08:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/arcade-mapviewer-pop-ups-not-loading-in-field/m-p/1700360#M23253</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2026-05-06T15:08:47Z</dc:date>
    </item>
  </channel>
</rss>

