<?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 Can't pass html tag as an arcade expression variable into web map popup in ArcGIS Arcade Questions</title>
    <link>https://community.esri.com/t5/arcgis-arcade-questions/can-t-pass-html-tag-as-an-arcade-expression/m-p/1662196#M95</link>
    <description>&lt;P&gt;In ArcGIS Pro Arcade Expression I can build a variable for an html tag and pass it to the popup window and it works.&amp;nbsp; But when I publish this as a web map, the variable just passes the html tag as dumb text - so much for Arcade being seamless, portable, and application agnostic :-(.&lt;/P&gt;&lt;P&gt;I'm trying to make the background-color of the div red or green depending on the value returned in the filter of the expression.&lt;/P&gt;&lt;P&gt;Here's what the variable looks like (where bg and myDelqTax are variables assigned earlier):&lt;/P&gt;&lt;P&gt;var html = "&amp;lt;div style='padding:8px; color:white; font-weight:bold; " +&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"border-radius:6px; background-color:" + bg + ";'&amp;gt;"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+ myDelqTax +&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"&amp;lt;/div&amp;gt;";&lt;BR /&gt;return html;&lt;/P&gt;&lt;P&gt;And here's how it looks in ArcGIS Pro popup:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PLadd_0-1761830324587.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/142892iFF41BD9B27298D1D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PLadd_0-1761830324587.png" alt="PLadd_0-1761830324587.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But when I publish to a web map, this is the result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PLadd_1-1761830594889.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/142894i2A944CF2E1E4FB3C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PLadd_1-1761830594889.png" alt="PLadd_1-1761830594889.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Maybe I'm reading &lt;A href="https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/td-p/1169232" target="_blank" rel="noopener"&gt;this post&lt;/A&gt; wrong, but it seems to indicate this might be available at 11.x (I'm at 11.5).&amp;nbsp; And don't get me started on what ai searches returned.&lt;/P&gt;&lt;P&gt;I also tried the "Arcade Expression Options" that went something like this but didn't work in web map:&lt;/P&gt;&lt;P&gt;return {&lt;BR /&gt;type : 'text',&lt;BR /&gt;text : '&amp;lt;div style="background-color:{expression/expressiontaxBG};"&amp;gt;&amp;lt;p&amp;gt;hello&amp;lt;p&amp;gt;&amp;lt;/div&amp;gt;'&lt;BR /&gt;// this property supports html tags&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Anybody know of a workaround to make an Arcade Expression in ArcGIS Pro that uses a variable holding html tags work in a web map?&lt;/P&gt;</description>
    <pubDate>Thu, 30 Oct 2025 14:05:46 GMT</pubDate>
    <dc:creator>PLadd</dc:creator>
    <dc:date>2025-10-30T14:05:46Z</dc:date>
    <item>
      <title>Can't pass html tag as an arcade expression variable into web map popup</title>
      <link>https://community.esri.com/t5/arcgis-arcade-questions/can-t-pass-html-tag-as-an-arcade-expression/m-p/1662196#M95</link>
      <description>&lt;P&gt;In ArcGIS Pro Arcade Expression I can build a variable for an html tag and pass it to the popup window and it works.&amp;nbsp; But when I publish this as a web map, the variable just passes the html tag as dumb text - so much for Arcade being seamless, portable, and application agnostic :-(.&lt;/P&gt;&lt;P&gt;I'm trying to make the background-color of the div red or green depending on the value returned in the filter of the expression.&lt;/P&gt;&lt;P&gt;Here's what the variable looks like (where bg and myDelqTax are variables assigned earlier):&lt;/P&gt;&lt;P&gt;var html = "&amp;lt;div style='padding:8px; color:white; font-weight:bold; " +&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"border-radius:6px; background-color:" + bg + ";'&amp;gt;"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+ myDelqTax +&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"&amp;lt;/div&amp;gt;";&lt;BR /&gt;return html;&lt;/P&gt;&lt;P&gt;And here's how it looks in ArcGIS Pro popup:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PLadd_0-1761830324587.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/142892iFF41BD9B27298D1D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PLadd_0-1761830324587.png" alt="PLadd_0-1761830324587.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But when I publish to a web map, this is the result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PLadd_1-1761830594889.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/142894i2A944CF2E1E4FB3C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PLadd_1-1761830594889.png" alt="PLadd_1-1761830594889.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Maybe I'm reading &lt;A href="https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/td-p/1169232" target="_blank" rel="noopener"&gt;this post&lt;/A&gt; wrong, but it seems to indicate this might be available at 11.x (I'm at 11.5).&amp;nbsp; And don't get me started on what ai searches returned.&lt;/P&gt;&lt;P&gt;I also tried the "Arcade Expression Options" that went something like this but didn't work in web map:&lt;/P&gt;&lt;P&gt;return {&lt;BR /&gt;type : 'text',&lt;BR /&gt;text : '&amp;lt;div style="background-color:{expression/expressiontaxBG};"&amp;gt;&amp;lt;p&amp;gt;hello&amp;lt;p&amp;gt;&amp;lt;/div&amp;gt;'&lt;BR /&gt;// this property supports html tags&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Anybody know of a workaround to make an Arcade Expression in ArcGIS Pro that uses a variable holding html tags work in a web map?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 14:05:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-arcade-questions/can-t-pass-html-tag-as-an-arcade-expression/m-p/1662196#M95</guid>
      <dc:creator>PLadd</dc:creator>
      <dc:date>2025-10-30T14:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Can't pass html tag as an arcade expression variable into web map popup</title>
      <link>https://community.esri.com/t5/arcgis-arcade-questions/can-t-pass-html-tag-as-an-arcade-expression/m-p/1662199#M96</link>
      <description>&lt;P&gt;You would need to use an Arcade Element in the popup and then use template literals to access the html&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var bg = '#xyzxyz'
var myDelqTax = "whatever this is"
var html = `&amp;lt;div style = "padding:8px; color:white; font-weight:bold;border-radius:6px; background-color:${bg}"&amp;gt;${myDelqTax}&amp;lt;/div&amp;gt; `                 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then use&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;return {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;type : 'text',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;text : html&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Portable, but not perfectly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 14:11:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-arcade-questions/can-t-pass-html-tag-as-an-arcade-expression/m-p/1662199#M96</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2025-10-30T14:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can't pass html tag as an arcade expression variable into web map popup</title>
      <link>https://community.esri.com/t5/arcgis-arcade-questions/can-t-pass-html-tag-as-an-arcade-expression/m-p/1662802#M97</link>
      <description>&lt;P&gt;&lt;!--  StartFragment   --&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Thanks for the reply&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/80456"&gt;@ZachBodenner&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;I tried what you are suggesting:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;In the Arcade expression I assign the variables as you've shown&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;Then I configure a popup using an Arcade Expression Option that grabs the html variable as an expression&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;It works in &lt;/SPAN&gt;&lt;SPAN class=""&gt;APro&lt;/SPAN&gt;&lt;SPAN class=""&gt; but doesn't work in Web Map when &lt;/SPAN&gt;&lt;SPAN class=""&gt;APro&lt;/SPAN&gt;&lt;SPAN class=""&gt; is published.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;Here's an abridged version of the Expression called {expression/&lt;/SPAN&gt;&lt;SPAN class=""&gt;expressionDelqTax&lt;/SPAN&gt;&lt;SPAN class=""&gt;}:&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;var &lt;/SPAN&gt;&lt;SPAN class=""&gt;bg&lt;/SPAN&gt;&lt;SPAN class=""&gt; = ""#F44336";&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;var &lt;/SPAN&gt;&lt;SPAN class=""&gt;myDelqTax&lt;/SPAN&gt;&lt;SPAN class=""&gt; = "$1234"&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;var html = "&amp;lt;div style='background-color:" + &lt;/SPAN&gt;&lt;SPAN class=""&gt;bg&lt;/SPAN&gt;&lt;SPAN class=""&gt; + ";'&amp;gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;+ "&amp;lt;b&amp;gt;DELINQUENT TAX ES OWED:&amp;lt;/b&amp;gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;br&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;" + &lt;/SPAN&gt;&lt;SPAN class=""&gt;myDelqTax&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;+"&amp;lt;/div&amp;gt;";&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;return html;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;Here's the how I configured the popup with an Arcade Expression Option:&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;return { &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;type : 'text', &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;text : '{expression/&lt;/SPAN&gt;&lt;SPAN class=""&gt;expressionDelqTax&lt;/SPAN&gt;&lt;SPAN class=""&gt;}'&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;// this property supports html tags &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;!--  EndFragment   --&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2025 13:18:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-arcade-questions/can-t-pass-html-tag-as-an-arcade-expression/m-p/1662802#M97</guid>
      <dc:creator>PLadd</dc:creator>
      <dc:date>2025-11-03T13:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Can't pass html tag as an arcade expression variable into web map popup</title>
      <link>https://community.esri.com/t5/arcgis-arcade-questions/can-t-pass-html-tag-as-an-arcade-expression/m-p/1662809#M98</link>
      <description>&lt;P&gt;Ah that's an important point: You can't pass an Arcade expression that you created elsewhere in the popup. You basically have to copy that code into the Arcade popup element itself in order to get the element to recognize it. It's kind of weird that way, I would think it should be able to access expressions built individually, but such is life.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2025 13:55:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-arcade-questions/can-t-pass-html-tag-as-an-arcade-expression/m-p/1662809#M98</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2025-11-03T13:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can't pass html tag as an arcade expression variable into web map popup</title>
      <link>https://community.esri.com/t5/arcgis-arcade-questions/can-t-pass-html-tag-as-an-arcade-expression/m-p/1662868#M99</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/80456"&gt;@ZachBodenner&lt;/a&gt;&amp;nbsp;I apologize.&amp;nbsp; I completely misunderstood how to use an Arcade Text Template (the one in the image below).&amp;nbsp; Your solution was actually the correct solution.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PLadd_0-1762187934211.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/143057i37AA181307CE10F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PLadd_0-1762187934211.png" alt="PLadd_0-1762187934211.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I thought first I had to create an {expression} and then call that expression using the above Arcade Text Template.&amp;nbsp; &lt;A href="https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-return-html-text/td-p/1315823" target="_blank" rel="noopener"&gt;This solution helped clarify&lt;/A&gt; what you were trying to point out.&lt;/P&gt;&lt;P&gt;I tested in a web map and it actually works now.&lt;/P&gt;&lt;P&gt;Everything goes into the Arcade Text Template (not in the Expressions section as I was trying to do).&lt;/P&gt;&lt;P&gt;var bg = '#xyzxyz'&lt;BR /&gt;var myDelqTax = "whatever this is" //a value derived from the feature clicked on but not shown here&lt;/P&gt;&lt;P&gt;var html =&lt;BR /&gt;"&amp;lt;div style='padding:8px; color:white; font-weight:bold; border-radius:6px; background-color:" + bg + ";'&amp;gt;"&lt;BR /&gt;"&amp;lt;b&amp;gt;DELINQUENT TAX SEARCH RESULTS:&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;" + myDelqTax +&amp;nbsp;"&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;"&lt;/P&gt;&lt;P&gt;return {&lt;BR /&gt;type : 'text',&lt;BR /&gt;text : html&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;To sum, if you want to use expression values inside an html and pass it to your popup, don't use the Expression button below and try to pass it to a configured popup.&amp;nbsp; Instead, use the Arcade button pointed to above.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PLadd_1-1762188314275.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/143058i608FBD5D355F30B7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PLadd_1-1762188314275.png" alt="PLadd_1-1762188314275.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks!&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>Mon, 03 Nov 2025 16:52:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-arcade-questions/can-t-pass-html-tag-as-an-arcade-expression/m-p/1662868#M99</guid>
      <dc:creator>PLadd</dc:creator>
      <dc:date>2025-11-03T16:52:39Z</dc:date>
    </item>
  </channel>
</rss>

