<?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 returns HTML in Pro, but not Online in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-returns-html-in-pro-but-not/m-p/1302340#M53034</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Short version:&lt;/STRONG&gt; I have an Arcade expression in Pro that returns HTML. When used in a popup text element, Pro displays the HTML as expected. When I publish to ArcGIS Online, it displays the source of the HTML, rather than rendering it. Am I doing something wrong, or is this just a limitation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;More Info:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;My expression: This just converts a semicolon delimited list into HTML bullets. It is named "Populations".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if (IsEmpty($feature.test_list)) {return "[&amp;lt;i&amp;gt;None found&amp;lt;/i&amp;gt;]"}

return "&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;" + Replace($feature.test_list, "; ", "&amp;lt;li&amp;gt;") + "&amp;lt;/ul&amp;gt;"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a simple text popup that displays this expression:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dcafdg_0-1687490649287.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/74009i4294C60517956162/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dcafdg_0-1687490649287.png" alt="dcafdg_0-1687490649287.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The popup renders the HTML in Pro as expected. This is just dummy data for testing, but the field value is "&lt;FONT face="courier new,courier" color="#993300"&gt;Otter; Bear; Lynx&lt;/FONT&gt;". Here is what displays:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dcafdg_1-1687490844117.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/74010i04A3B7250DCC7C16/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dcafdg_1-1687490844117.png" alt="dcafdg_1-1687490844117.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I share this to a hosted feature layer in ArcGIS Online, the expression comes across fine under the new item's "Visualization" tab. When I click on a feature, the expression runs and returns the HTML, but the popup just renders it as text.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dcafdg_2-1687491052385.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/74011i407C13DF155F7C52/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dcafdg_2-1687491052385.png" alt="dcafdg_2-1687491052385.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After failing to make it work with a text element and expressions, I got something similar working as an Arcade element. I couldn't figure out how to consume the expression there, so I recreated the expression as functions. This approach did render the HTML in ArcGIS Online, and it also worked when I added that hosted feature layer as a Pro map layer.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dcafdg_3-1687491136477.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/74012iB852CB8C3F36B6E6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dcafdg_3-1687491136477.png" alt="dcafdg_3-1687491136477.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This functionally does the same thing as consuming an expression in a text element, but solves it in a different way. Maybe I'm missing something, but I thought&amp;nbsp;&lt;STRONG&gt;the whole point&lt;/STRONG&gt; of Arcade was that it was supposed to be portable and work anywhere!?!?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt; Pro renders HTML returned from an expression in the popups, but ArcGIS Online does not. Is there some way to get that to work, or is that just a limitation?&lt;/P&gt;&lt;P&gt;If I can't solve this, I think I'll just design my popups in ArcGIS Online using the Arcade element type. I can pull them into Pro as needed. Is that a pretty common workflow? I really like having instantaneous access to the console in a browser for development, so maybe this really is the way to go.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jun 2023 16:49:06 GMT</pubDate>
    <dc:creator>davedoesgis</dc:creator>
    <dc:date>2023-06-23T16:49:06Z</dc:date>
    <item>
      <title>Arcade expression returns HTML in Pro, but not Online</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-returns-html-in-pro-but-not/m-p/1302340#M53034</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Short version:&lt;/STRONG&gt; I have an Arcade expression in Pro that returns HTML. When used in a popup text element, Pro displays the HTML as expected. When I publish to ArcGIS Online, it displays the source of the HTML, rather than rendering it. Am I doing something wrong, or is this just a limitation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;More Info:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;My expression: This just converts a semicolon delimited list into HTML bullets. It is named "Populations".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if (IsEmpty($feature.test_list)) {return "[&amp;lt;i&amp;gt;None found&amp;lt;/i&amp;gt;]"}

return "&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;" + Replace($feature.test_list, "; ", "&amp;lt;li&amp;gt;") + "&amp;lt;/ul&amp;gt;"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a simple text popup that displays this expression:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dcafdg_0-1687490649287.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/74009i4294C60517956162/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dcafdg_0-1687490649287.png" alt="dcafdg_0-1687490649287.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The popup renders the HTML in Pro as expected. This is just dummy data for testing, but the field value is "&lt;FONT face="courier new,courier" color="#993300"&gt;Otter; Bear; Lynx&lt;/FONT&gt;". Here is what displays:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dcafdg_1-1687490844117.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/74010i04A3B7250DCC7C16/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dcafdg_1-1687490844117.png" alt="dcafdg_1-1687490844117.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I share this to a hosted feature layer in ArcGIS Online, the expression comes across fine under the new item's "Visualization" tab. When I click on a feature, the expression runs and returns the HTML, but the popup just renders it as text.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dcafdg_2-1687491052385.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/74011i407C13DF155F7C52/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dcafdg_2-1687491052385.png" alt="dcafdg_2-1687491052385.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After failing to make it work with a text element and expressions, I got something similar working as an Arcade element. I couldn't figure out how to consume the expression there, so I recreated the expression as functions. This approach did render the HTML in ArcGIS Online, and it also worked when I added that hosted feature layer as a Pro map layer.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dcafdg_3-1687491136477.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/74012iB852CB8C3F36B6E6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dcafdg_3-1687491136477.png" alt="dcafdg_3-1687491136477.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This functionally does the same thing as consuming an expression in a text element, but solves it in a different way. Maybe I'm missing something, but I thought&amp;nbsp;&lt;STRONG&gt;the whole point&lt;/STRONG&gt; of Arcade was that it was supposed to be portable and work anywhere!?!?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt; Pro renders HTML returned from an expression in the popups, but ArcGIS Online does not. Is there some way to get that to work, or is that just a limitation?&lt;/P&gt;&lt;P&gt;If I can't solve this, I think I'll just design my popups in ArcGIS Online using the Arcade element type. I can pull them into Pro as needed. Is that a pretty common workflow? I really like having instantaneous access to the console in a browser for development, so maybe this really is the way to go.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 16:49:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-returns-html-in-pro-but-not/m-p/1302340#M53034</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2023-06-23T16:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression returns HTML in Pro, but not Online</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-returns-html-in-pro-but-not/m-p/1303208#M53090</link>
      <description>&lt;P&gt;I had a similar problem a few months back; we had a popup that worked fine in Classic Map Viewer, but not the new one.&amp;nbsp;I want to say I found a document saying HTML expressions are not recognized as such in Text element, but memory is a little hazy at this point...&lt;/P&gt;&lt;P&gt;I wound up doing what you did in an Arcade element. Afterwards I made the functions generic enough that I can re-use them wherever, and now I don't bother with Text; pure Arcade is less work to setup and easier to maintain for what I need it for. Definitely prefer the AGOL editor too.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 22:58:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-returns-html-in-pro-but-not/m-p/1303208#M53090</guid>
      <dc:creator>CMV_Erik</dc:creator>
      <dc:date>2023-06-26T22:58:40Z</dc:date>
    </item>
  </channel>
</rss>

