<?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 Remove text between brackets with arcade in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/remove-text-between-brackets-with-arcade/m-p/1114572#M47576</link>
    <description>&lt;P&gt;Hello, I need to remove all html elements in text fields from popups in ArcGIS Pro/ArcGIS Enterprise.&amp;nbsp; Text fields could contain multiple instances of &amp;lt;&amp;gt;.&lt;/P&gt;&lt;P&gt;text field - Description&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;p&amp;gt;&amp;lt;span style="color: rgb(68, 68, 68);"&amp;gt;&lt;/STRONG&gt;this artwork was commissioned through the City's&lt;STRONG&gt; &amp;lt;/span&amp;gt;&lt;/STRONG&gt;Hogan Alley Artist Call 2019.&lt;STRONG&gt;&amp;amp;nbsp;&amp;lt;span style="color: rgb(68, 68, 68);"&amp;gt;&lt;/STRONG&gt;In February 2019, the City invited proposals for a temporary painted mural.&lt;STRONG&gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Can't find a way to set this up with Arcade&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;OM&lt;/P&gt;</description>
    <pubDate>Fri, 05 Nov 2021 17:16:42 GMT</pubDate>
    <dc:creator>OM</dc:creator>
    <dc:date>2021-11-05T17:16:42Z</dc:date>
    <item>
      <title>Remove text between brackets with arcade</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-text-between-brackets-with-arcade/m-p/1114572#M47576</link>
      <description>&lt;P&gt;Hello, I need to remove all html elements in text fields from popups in ArcGIS Pro/ArcGIS Enterprise.&amp;nbsp; Text fields could contain multiple instances of &amp;lt;&amp;gt;.&lt;/P&gt;&lt;P&gt;text field - Description&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;p&amp;gt;&amp;lt;span style="color: rgb(68, 68, 68);"&amp;gt;&lt;/STRONG&gt;this artwork was commissioned through the City's&lt;STRONG&gt; &amp;lt;/span&amp;gt;&lt;/STRONG&gt;Hogan Alley Artist Call 2019.&lt;STRONG&gt;&amp;amp;nbsp;&amp;lt;span style="color: rgb(68, 68, 68);"&amp;gt;&lt;/STRONG&gt;In February 2019, the City invited proposals for a temporary painted mural.&lt;STRONG&gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Can't find a way to set this up with Arcade&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;OM&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 17:16:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-text-between-brackets-with-arcade/m-p/1114572#M47576</guid>
      <dc:creator>OM</dc:creator>
      <dc:date>2021-11-05T17:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: Remove text between brackets with arcade</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-text-between-brackets-with-arcade/m-p/1114665#M47586</link>
      <description>&lt;P&gt;It's not terribly elegant, but you can do this with a few nested loops and some splitting and searching.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var str = your-string-attribute

// Split input string by '&amp;gt;' char
var splits = Split(str, '&amp;gt;', -1, True)

// Empty string for output
var outstr = ''

// Iterate over split string
for (var s in splits){
    var substr = splits[s]
    
    // Find items not beginning w/ '&amp;lt;', i.e., not HTML tags
    if (Left(substr, 1) != '&amp;lt;'){
        
        // Check if string ends w/ HTML tag
        var i = Find('&amp;lt;', substr)
        
        // Trim HTML tag from end if present
        if (i != -1){
            substr = Left(substr, i)
        }
        
        outstr += substr
    }
}

outstr&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And for the proof:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1636145966273.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/26934i17E62490157E8D7F/image-size/large?v=v2&amp;amp;px=999" role="button" title="jcarlson_0-1636145966273.png" alt="jcarlson_0-1636145966273.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You'll notice the "&amp;amp;nbsp;" does not get removed, but we were only looking for HTML tags. These could easily be stripped out with a &lt;STRONG&gt;Replace&lt;/STRONG&gt; function, though. Or rather than stripping them out, replacing them with &lt;STRONG&gt;'\n'&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 21:01:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-text-between-brackets-with-arcade/m-p/1114665#M47586</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-11-05T21:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Remove text between brackets with arcade</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-text-between-brackets-with-arcade/m-p/1114974#M47631</link>
      <description>&lt;P&gt;Can't thank you enough for solving this.&amp;nbsp; It worked great.&lt;/P&gt;&lt;P&gt;Olga&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 18:17:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-text-between-brackets-with-arcade/m-p/1114974#M47631</guid>
      <dc:creator>OM</dc:creator>
      <dc:date>2021-11-08T18:17:09Z</dc:date>
    </item>
  </channel>
</rss>

