<?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: Use Attribute Rules to remove text from a field in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114579#M47570</link>
    <description>&lt;P&gt;Are you looking for the exact value, 'R4'?&lt;/P&gt;&lt;P&gt;Then, check the following syntax&lt;/P&gt;&lt;P&gt;Parser: Arcade&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IIF(FIND('R4',$feature.FIELDNAME,0)==-1,'','R4')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Let me know a few more examples if the substring value is dynamic.&lt;/P&gt;</description>
    <pubDate>Fri, 05 Nov 2021 17:27:36 GMT</pubDate>
    <dc:creator>JayantaPoddar</dc:creator>
    <dc:date>2021-11-05T17:27:36Z</dc:date>
    <item>
      <title>Use Attribute Rules to remove text from a field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114530#M47564</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am extremely new at using attribute rules and Arcade for ArcGIS Pro, and I need some help on what I am sure is a simple process.&lt;/P&gt;&lt;P&gt;I have a column filled with text like this, "R4-52" and "H-R4-52" What I would like to do is use arcade to populate a new field where the output will be "R4", basically removing the dash and any characters before and after the dash. I know the replace function can be used to do this, but I wasn't able to find any examples.&lt;BR /&gt;&lt;BR /&gt;Can someone help with this?&lt;/P&gt;&lt;P&gt;Much appreciated,&lt;/P&gt;&lt;P&gt;Justin&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 16:02:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114530#M47564</guid>
      <dc:creator>JustinBernard1886</dc:creator>
      <dc:date>2021-11-05T16:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Use Attribute Rules to remove text from a field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114548#M47566</link>
      <description>&lt;P&gt;What about &lt;A href="https://developers.arcgis.com/arcade/function-reference/text_functions/" target="_self"&gt;the left() function?&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 16:51:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114548#M47566</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-11-05T16:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Use Attribute Rules to remove text from a field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114579#M47570</link>
      <description>&lt;P&gt;Are you looking for the exact value, 'R4'?&lt;/P&gt;&lt;P&gt;Then, check the following syntax&lt;/P&gt;&lt;P&gt;Parser: Arcade&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IIF(FIND('R4',$feature.FIELDNAME,0)==-1,'','R4')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Let me know a few more examples if the substring value is dynamic.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 17:27:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114579#M47570</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2021-11-05T17:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Use Attribute Rules to remove text from a field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114582#M47571</link>
      <description>&lt;P&gt;Thanks for the reply!&lt;BR /&gt;The values are dynamic, my apologies.&amp;nbsp;&lt;BR /&gt;I basically would like to remove the &amp;lt;text&amp;gt;"-" , "-'&amp;lt;text&amp;gt; and keep the middle characters.&lt;BR /&gt;Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 17:34:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114582#M47571</guid>
      <dc:creator>JustinBernard1886</dc:creator>
      <dc:date>2021-11-05T17:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Use Attribute Rules to remove text from a field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114583#M47572</link>
      <description>&lt;P&gt;Do you have one "-" or more than two "-" instances in the string? What to do in those cases?&lt;/P&gt;&lt;P&gt;e.g.: &lt;EM&gt;HE-77-L-0&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 17:38:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114583#M47572</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2021-11-05T17:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Use Attribute Rules to remove text from a field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114588#M47573</link>
      <description>&lt;P&gt;Just one and two dashes&lt;BR /&gt;eg: R3-1, and H-R4-2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 17:42:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114588#M47573</guid>
      <dc:creator>JustinBernard1886</dc:creator>
      <dc:date>2021-11-05T17:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Use Attribute Rules to remove text from a field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114609#M47579</link>
      <description>&lt;P&gt;Parser: Arcade&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SPLIT($feature.FIELDNAME,'-')[-2]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 19:07:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114609#M47579</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2021-11-05T19:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Use Attribute Rules to remove text from a field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114611#M47580</link>
      <description>&lt;P&gt;I thought this is in the context of an Attribute Rule; in that case Arcade is the only option.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 19:02:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114611#M47580</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-11-05T19:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Use Attribute Rules to remove text from a field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114615#M47581</link>
      <description>&lt;P&gt;Ahh. I see. Removed the Python one.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 19:07:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114615#M47581</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2021-11-05T19:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Use Attribute Rules to remove text from a field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114625#M47583</link>
      <description>&lt;P&gt;Another approach:&amp;nbsp; split the string at the dashes into &lt;A href="https://developers.arcgis.com/arcade/function-reference/data_functions/#array" target="_self"&gt;an array&lt;/A&gt; and then get &lt;A href="https://developers.arcgis.com/arcade/function-reference/data_functions/#count" target="_self"&gt;the count&lt;/A&gt; of that array.&amp;nbsp; If the count indicates 1 dash, grab the first element of the array; if the count indicates 2 dashes, grab the second element of the array.&amp;nbsp; I'm pretty sure arcade arrays are 0 based.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 19:18:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114625#M47583</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-11-05T19:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Use Attribute Rules to remove text from a field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114632#M47584</link>
      <description>&lt;P&gt;Five minutes in the &lt;A href="https://developers.arcgis.com/arcade/playground/" target="_self"&gt;ESRI Arcade playground&lt;/A&gt;&amp;nbsp;and I came up with this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var name = ' R3-1';
Console(name)
var nameArray = Split(name,'-')
Console(nameArray)
var arrayLength = Count(nameArray)
Console(arrayLength)

if (arrayLength == 2) {
    Console(nameArray[0])
}&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="JoeBorgione_0-1636140938445.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/26928i63D46833780A8A00/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JoeBorgione_0-1636140938445.png" alt="JoeBorgione_0-1636140938445.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The Console() function is like the print() function in python, but it only works in the playground.&amp;nbsp; This is nothing more than python logic in Arcade...&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 19:38:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1114632#M47584</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-11-05T19:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Use Attribute Rules to remove text from a field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1115793#M47732</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;So I was able to find a solution that fit my needs. Thanks so much for all the &lt;A href="mailto:help@!" target="_blank"&gt;help!&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Justin&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 19:27:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1115793#M47732</guid>
      <dc:creator>JustinBernard1886</dc:creator>
      <dc:date>2021-11-10T19:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Use Attribute Rules to remove text from a field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1115805#M47733</link>
      <description>&lt;P&gt;Care to share?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 19:55:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1115805#M47733</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-11-10T19:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Use Attribute Rules to remove text from a field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1116817#M47829</link>
      <description>&lt;P&gt;Here:&lt;/P&gt;&lt;P&gt;(I did not write this)&lt;/P&gt;&lt;P&gt;var ZoneCodeName = $feature.CENTROID;&lt;BR /&gt;var ZoneCodeFndDash = Find('-', ZoneCodeName, 0);&lt;BR /&gt;var ZoneCodeFndLBracket = Find('(', ZoneCodeName, 0);&lt;BR /&gt;var Char1 = Mid(ZoneCodeName,0,1);&lt;BR /&gt;var Char2 = Mid(ZoneCodeName,1,1);&lt;BR /&gt;if (Char1=="H"){&lt;BR /&gt;var ZoneCodeCount = Count(ZoneCodeName);&lt;BR /&gt;var ZoneCodeName = Mid(ZoneCodeName, 2, ZoneCodeCount);&lt;BR /&gt;var ZoneCodeFndDash = Find('-', ZoneCodeName, 0);&lt;BR /&gt;var ZoneCodeFndLBracket = Find('(', ZoneCodeName, 0);&lt;BR /&gt;if (ZoneCodeFndDash!=-1){&lt;BR /&gt;var ZoneCodePre = Mid(ZoneCodeName, 0, ZoneCodeFndDash);&lt;BR /&gt;return ZoneCodePre;&lt;BR /&gt;}&lt;BR /&gt;if (ZoneCodeFndLBracket!=-1){&lt;BR /&gt;var ZoneCodePre = Mid(ZoneCodeName, 0, ZoneCodeFndLBracket);&lt;BR /&gt;return ZoneCodePre;&lt;BR /&gt;}&lt;BR /&gt;return ZoneCodeName;&lt;BR /&gt;}&lt;BR /&gt;if (ZoneCodeFndDash!=-1){&lt;BR /&gt;var ZoneCodePre = Mid(ZoneCodeName, 0, ZoneCodeFndDash);&lt;BR /&gt;return ZoneCodePre;&lt;BR /&gt;}&lt;BR /&gt;if (ZoneCodeFndLBracket!=-1){&lt;BR /&gt;var ZoneCodePre = Mid(ZoneCodeName, 0, ZoneCodeFndLBracket);&lt;BR /&gt;return ZoneCodePre;&lt;BR /&gt;}&lt;BR /&gt;return ZoneCodeName;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 12:30:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-attribute-rules-to-remove-text-from-a-field/m-p/1116817#M47829</guid>
      <dc:creator>JustinBernard1886</dc:creator>
      <dc:date>2021-11-15T12:30:15Z</dc:date>
    </item>
  </channel>
</rss>

