<?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: Append tool not honoring common fields in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/append-tool-not-honoring-common-fields/m-p/590168#M46282</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;NO_TEST always brought over the common fields just fine for me.&amp;nbsp; I use it a lot actually.&amp;nbsp; I am trying to remember if a Join messed it up.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Feb 2019 21:31:18 GMT</pubDate>
    <dc:creator>DougBrowning</dc:creator>
    <dc:date>2019-02-13T21:31:18Z</dc:date>
    <item>
      <title>Append tool not honoring common fields</title>
      <link>https://community.esri.com/t5/python-questions/append-tool-not-honoring-common-fields/m-p/590164#M46278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using a FGDB feature class that has a field called "MgmtTractID" of string type. It has the exact same properties and name as a field in my feature class in an SDE geodatabase. Unfortunately, the attributes from MgmtTractID in my FGDB will not transfer to the SDE MgmtTractID field. I'm not sure why, if I use the Append tool (with selections on my FGDB feature class) in the GUI, it works fine. I use "NO_TEST" because some of the fields aren't common between the two feature classes. I have also checked with a search cursor that my feature layer contains the values I would like to transfer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Append_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mgmtTractFL&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; db_mgmtTractFC&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'NO_TEST'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The documentation for the Append tool states this:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;Map layers can be used as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d; background-color: #fefefe; font-weight: bold;"&gt;Input Datasets&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;. If a layer has a selection, only the selected records (features or table rows) are used by the Append tool.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So why doesn't it work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2019 20:26:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-tool-not-honoring-common-fields/m-p/590164#M46278</guid>
      <dc:creator>MKF62</dc:creator>
      <dc:date>2019-02-07T20:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Append tool not honoring common fields</title>
      <link>https://community.esri.com/t5/python-questions/append-tool-not-honoring-common-fields/m-p/590165#M46279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I had assumed that when you use "NO_TEST" it would default to using whatever common fields are there. Turns out you have to actually use field map objects. So this is what I ended up with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;fieldmap &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FieldMappings&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fieldmap&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addTable&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;db_mgmtTractFC&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fieldmap&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addTable&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mgmtTractFL&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fieldmap&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;removeAll&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fm_TractID &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FieldMap&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fm_TractID&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addInputField&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;db_mgmtTractFC&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MgmtTractID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#I had a joined table,so I had to specify the field by putting the name of &lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#the layer at the beginning of the field name&lt;/SPAN&gt;
fm_TractID&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addInputField&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mgmtTractFL&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"AL_MgmtTracts_Template.MgmtTractID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fieldmap&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addFieldMap&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fm_TractID&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Append_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mgmtTractFL&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; db_mgmtTractFC&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'NO_TEST'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fieldmap&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:21:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-tool-not-honoring-common-fields/m-p/590165#M46279</guid>
      <dc:creator>MKF62</dc:creator>
      <dc:date>2021-12-12T01:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Append tool not honoring common fields</title>
      <link>https://community.esri.com/t5/python-questions/append-tool-not-honoring-common-fields/m-p/590166#M46280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I started to reply to your original post, but when I posted, you'd already deleted it.&amp;nbsp; So I'll try again now...&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I take it you are using a feature layer, mgmtTractFL because you've made a selection via a script, right?&amp;nbsp; And you mentioned it worked with the tool interface but not with arcpy.Append_management.&amp;nbsp; When it is successful with the tool are you using the feature layer, or the actual feature class?&amp;nbsp; It does seem odd, indeed....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll see if I can replicate the problem here locally with something on hand....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hahaha.&amp;nbsp; now you've beaten me to the punch again!&amp;nbsp; Good job on using field mapping.&amp;nbsp; I've never had that work for me, and I've never known anyone to get it to work!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2019 20:57:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-tool-not-honoring-common-fields/m-p/590166#M46280</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-02-07T20:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Append tool not honoring common fields</title>
      <link>https://community.esri.com/t5/python-questions/append-tool-not-honoring-common-fields/m-p/590167#M46281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Field mapping is super confusing in arcpy. It took me a while to figure it out switching back and forth between the FieldMappings and FieldMap help documents.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2019 18:28:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-tool-not-honoring-common-fields/m-p/590167#M46281</guid>
      <dc:creator>MKF62</dc:creator>
      <dc:date>2019-02-08T18:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Append tool not honoring common fields</title>
      <link>https://community.esri.com/t5/python-questions/append-tool-not-honoring-common-fields/m-p/590168#M46282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;NO_TEST always brought over the common fields just fine for me.&amp;nbsp; I use it a lot actually.&amp;nbsp; I am trying to remember if a Join messed it up.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2019 21:31:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-tool-not-honoring-common-fields/m-p/590168#M46282</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2019-02-13T21:31:18Z</dc:date>
    </item>
  </channel>
</rss>

