<?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: Copy Features removing majority of field name in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/copy-features-removing-majority-of-field-name/m-p/1413474#M70409</link>
    <description>&lt;P&gt;Nice work!&lt;/P&gt;</description>
    <pubDate>Mon, 22 Apr 2024 12:47:49 GMT</pubDate>
    <dc:creator>AlfredBaldenweck</dc:creator>
    <dc:date>2024-04-22T12:47:49Z</dc:date>
    <item>
      <title>Copy Features removing majority of field name</title>
      <link>https://community.esri.com/t5/python-questions/copy-features-removing-majority-of-field-name/m-p/1412409#M70388</link>
      <description>&lt;P&gt;Hey All,&lt;/P&gt;&lt;P&gt;I'm sure I'm doing something very obvious that I'm missing, when using arcpy and the CopyFeatures tool, I'm running into an issue where it removes everything in a field name after an underscore. Here are some screenshots:&lt;/P&gt;&lt;P&gt;Before:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CodyPatterson_0-1713546981127.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/101549i891E1323E82D25BE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CodyPatterson_0-1713546981127.png" alt="CodyPatterson_0-1713546981127.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;After:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CodyPatterson_1-1713547145905.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/101551iBDF4DA0B43C4C525/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CodyPatterson_1-1713547145905.png" alt="CodyPatterson_1-1713547145905.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I saw in the Copy Features geoprocessing tool I can enable "Maintain fully qualified field names" but I see no way to do this in Python, is there a way?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.management.CopyFeatures(NID_Layer, output_fc)&lt;/LI-CODE&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 17:20:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/copy-features-removing-majority-of-field-name/m-p/1412409#M70388</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2024-04-19T17:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Features removing majority of field name</title>
      <link>https://community.esri.com/t5/python-questions/copy-features-removing-majority-of-field-name/m-p/1412413#M70389</link>
      <description>&lt;P&gt;If the output is a Shapefile, they can only have field names 10 characters long, max. Anything longer gets cut off.&lt;/P&gt;&lt;P&gt;Use a geopackage or mobile geodatabase instead if you need to easily share the data and maintain the field names.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 17:22:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/copy-features-removing-majority-of-field-name/m-p/1412413#M70389</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2024-04-19T17:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Features removing majority of field name</title>
      <link>https://community.esri.com/t5/python-questions/copy-features-removing-majority-of-field-name/m-p/1412419#M70390</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/458875"&gt;@AlfredBaldenweck&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Oddly enough, it immediately converts the feature layer into a shapefile after this copy occurs, the main reason for this is to eventually stack the information into a feature class, but since the field names are different, it doesn't allow that to happen. Would you know of a way to to map this structure_ field to structure_name when using the append tool? Any type of change I've made has just placed "Null"&lt;/P&gt;&lt;LI-CODE lang="python"&gt;field_mappings = arcpy.FieldMappings()

field_map_ipid = arcpy.FieldMap()
field_map_clli = arcpy.FieldMap()

field_ipid = arcpy.Field()
field_ipid.name = "ipid"
field_clli = arcpy.Field()
field_clli.name = "structure_"

field_map_ipid.addInputField(output_fc, "ipid")
field_map_clli.addInputField(output_fc, "structure_")

field_mappings.addFieldMap(field_map_ipid)
field_mappings.addFieldMap(field_map_clli)&lt;/LI-CODE&gt;&lt;P&gt;This is my attempt so far&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 17:31:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/copy-features-removing-majority-of-field-name/m-p/1412419#M70390</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2024-04-19T17:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Features removing majority of field name</title>
      <link>https://community.esri.com/t5/python-questions/copy-features-removing-majority-of-field-name/m-p/1413429#M70406</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/458875"&gt;@AlfredBaldenweck&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to find a way around it, I had to use the append tool along with a new source on the actual output of structure_name that I wanted to use, I've attached a screenshot of what I did. I converted the actual geoprocessing tool to Python using the drop down next to run and then input my variables and everything worked! (This was after the Copy Features, as structure is cut down)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CodyPatterson_0-1713783672939.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/101683i81370865F076C95B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CodyPatterson_0-1713783672939.png" alt="CodyPatterson_0-1713783672939.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 11:02:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/copy-features-removing-majority-of-field-name/m-p/1413429#M70406</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2024-04-22T11:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Features removing majority of field name</title>
      <link>https://community.esri.com/t5/python-questions/copy-features-removing-majority-of-field-name/m-p/1413474#M70409</link>
      <description>&lt;P&gt;Nice work!&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 12:47:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/copy-features-removing-majority-of-field-name/m-p/1413474#M70409</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2024-04-22T12:47:49Z</dc:date>
    </item>
  </channel>
</rss>

