<?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: HTML Tags in Arcade Expressions for Popups in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/m-p/1190867#M33455</link>
    <description>&lt;P&gt;I don't know if this is quite what you're looking to do, but I just recently discovered using the rich text content element. It lets you use html tags to format your pop-up text along with the typical Arcade expressions.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/part-1-introducing-arcade-pop-up-content-elements/" target="_blank"&gt;https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/part-1-introducing-arcade-pop-up-content-elements/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jul 2022 15:37:53 GMT</pubDate>
    <dc:creator>JohnNergeBrooklynPark</dc:creator>
    <dc:date>2022-07-08T15:37:53Z</dc:date>
    <item>
      <title>HTML Tags in Arcade Expressions for Popups</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/m-p/1169232#M33051</link>
      <description>&lt;P&gt;Good Morning,&lt;/P&gt;&lt;P&gt;Here is my conundrum. Our organization has moved to 10.9.1 (finally) and I am stoked that I can finally bring in content from related data table layers into a feature layer popup. I was able to get the functionality working (i.e. grab related layer from a data table based on a common field) combine that data with some HTML tags for styling and then return the results (e.g. "&amp;lt;h1&amp;gt;" + filed_value + "&amp;lt;/h1&amp;gt;"; ) so that it looks nice in the popup, the popup displays the HTML tags rather than rendering them (as they would if I just used the html tags in the popup directly. I realize that I could just return the data from the expression and style it as needed in the popup but the data that is return is a list of data (more than one record).&lt;/P&gt;&lt;P&gt;UPDATE (added Arcade Expression code and popup output):&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var x = $feature['bail_go'];
var fs = FeatureSetByName($map, 'sureties');
var filt = Filter(fs,'bail_go = @x');
var cnt = Count(filt);
var sureties = "";
if (cnt &amp;gt; 0) {
    for (var surety in filt) {
        var bail_go = "&amp;lt;p&amp;gt;&amp;lt;span style='color:#d6d6d6'&amp;gt;&amp;lt;em&amp;gt;" + surety.bail_go + "&amp;lt;/em&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;";
        var txt_date = Text(surety.dob, ' - (Y/MM/DD) ');
        var surety_tombstone_info = "&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;&amp;lt;span style='color:#d6d6d6'&amp;gt;" + surety.g1 + "&amp;amp;nbsp;" + surety.surname + "&amp;lt;/span&amp;gt;&amp;lt;/strong&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;" + surety.sex + "-&amp;amp;nbsp;" + txt_date + "&amp;lt;/p&amp;gt;";
        var address = "&amp;lt;p&amp;gt;" + surety.address + ",&amp;amp;nbsp;" + surety.city + ",&amp;amp;nbsp;" + surety.province + ",&amp;amp;nbsp;" + surety.postal_code + "&amp;lt;/p&amp;gt;";
        var final = bail_go + TextFormatting.NewLine + surety_tombstone_info + TextFormatting.NewLine + address;
        sureties += final;
    }
    
} else {
        
sureties = "No Sureties";
}
return sureties;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="awgeezrick_0-1651238092598.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/40201i1E8E21C5B6F91DC9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="awgeezrick_0-1651238092598.png" alt="awgeezrick_0-1651238092598.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;awgeezrick_0-1651238092598.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any guidance, insight, assistance is greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 13:15:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/m-p/1169232#M33051</guid>
      <dc:creator>awgeezrick</dc:creator>
      <dc:date>2022-04-29T13:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: HTML Tags in Arcade Expressions for Popups</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/m-p/1169246#M33052</link>
      <description>&lt;P&gt;Hello, it will be useful if you'll post Arcade expression you used.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 12:44:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/m-p/1169246#M33052</guid>
      <dc:creator>MichaelGinzburg</dc:creator>
      <dc:date>2022-04-29T12:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: HTML Tags in Arcade Expressions for Popups</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/m-p/1169250#M33053</link>
      <description>&lt;P&gt;It looks like you didn't change to HTML-Source, when entering your data.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 12:46:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/m-p/1169250#M33053</guid>
      <dc:creator>KarstenRank</dc:creator>
      <dc:date>2022-04-29T12:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: HTML Tags in Arcade Expressions for Popups</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/m-p/1169268#M33054</link>
      <description>&lt;P&gt;You can't actually do this sort of thing in 10.9.1 in the way that you're hoping. In 11.0, there will be a new&amp;nbsp;&lt;STRONG&gt;Arcade&lt;/STRONG&gt; element you can add to your popups that supports HTML tags like this, but at the moment, the output of your expression will only come into the popup as a string, so "&amp;lt;b&amp;gt;bold text&amp;lt;/b&amp;gt;" comes in just like that, rather than the "&lt;STRONG&gt;bold text&lt;/STRONG&gt;" you would expect.&lt;/P&gt;&lt;P&gt;For the time being, you will only be able to do this by applying the style in the popup HTML, rather than in the expression itself.&lt;/P&gt;&lt;P&gt;If you HTML styling needs to be dynamic, you&amp;nbsp;&lt;EM&gt;can&amp;nbsp;&lt;/EM&gt;pipe an expression into the&amp;nbsp;&lt;STRONG&gt;style&lt;/STRONG&gt; tag of an HTML element. Say you had an expression:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Iif($feature['some_attribute'] == 'Important', 'bold', 'normal')&lt;/LI-CODE&gt;&lt;P&gt;You could then pipe that expression in like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div style="font-weight:{expression/expr0}"&amp;gt;Some text here&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;The text "Some text here" will now dynamically change between bold and normal text, depending on the evaluation of the expression above.&lt;/P&gt;&lt;P&gt;While doable, this method requires you to write an expression for every style element that you want to define by some attribute, and can be quite tedious. You also can't utilize any other HTML tags like lists and such.&lt;/P&gt;&lt;P&gt;It's possible to hard-code a number of HTML elements and use expressions to define whether or not they are visible, using the CSS property&amp;nbsp;&lt;STRONG&gt;display&lt;/STRONG&gt;. But since you're working with related data, the number of related records may not be known. So you might write a bunch of expressions to return up to, say, 10 list items, even if most features will not have that many. Again, very tedious, and will probably impact performance.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 13:11:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/m-p/1169268#M33054</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-04-29T13:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: HTML Tags in Arcade Expressions for Popups</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/m-p/1169274#M33055</link>
      <description>&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;I have updated the post with the Arcade Expression and the output as shown in the PopUp.&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 13:15:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/m-p/1169274#M33055</guid>
      <dc:creator>awgeezrick</dc:creator>
      <dc:date>2022-04-29T13:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: HTML Tags in Arcade Expressions for Popups</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/m-p/1169275#M33056</link>
      <description>&lt;P&gt;Yargh!&lt;/P&gt;&lt;P&gt;Thanks for the detailed response. Not the one I was hoping for, but appreciated none the less. =]&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 13:17:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/m-p/1169275#M33056</guid>
      <dc:creator>awgeezrick</dc:creator>
      <dc:date>2022-04-29T13:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: HTML Tags in Arcade Expressions for Popups</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/m-p/1169288#M33057</link>
      <description>&lt;P&gt;Thanks for the reply, but when I am creating the popup I am using the HTML-source so that I can enter the {expression/expression12} value properly. But what happens is when the expression is rendered in the popup window it displays the html tags that were included in the expression return. As per &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt; indicated, the expression returns the expression as a string so the html tags are displayed as such.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 13:25:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/m-p/1169288#M33057</guid>
      <dc:creator>awgeezrick</dc:creator>
      <dc:date>2022-04-29T13:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: HTML Tags in Arcade Expressions for Popups</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/m-p/1190867#M33455</link>
      <description>&lt;P&gt;I don't know if this is quite what you're looking to do, but I just recently discovered using the rich text content element. It lets you use html tags to format your pop-up text along with the typical Arcade expressions.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/part-1-introducing-arcade-pop-up-content-elements/" target="_blank"&gt;https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/part-1-introducing-arcade-pop-up-content-elements/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 15:37:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/m-p/1190867#M33455</guid>
      <dc:creator>JohnNergeBrooklynPark</dc:creator>
      <dc:date>2022-07-08T15:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: HTML Tags in Arcade Expressions for Popups</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/m-p/1191874#M33491</link>
      <description>&lt;P&gt;Thanks for the link John. I will give it a look.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 13:29:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/html-tags-in-arcade-expressions-for-popups/m-p/1191874#M33491</guid>
      <dc:creator>awgeezrick</dc:creator>
      <dc:date>2022-07-13T13:29:54Z</dc:date>
    </item>
  </channel>
</rss>

