<?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 data not appending attributes in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/1412206#M70380</link>
    <description>&lt;P&gt;Thanks Martin! Using a field mapping object was the only working solution for appending to an sde feature class&lt;/P&gt;</description>
    <pubDate>Fri, 19 Apr 2024 13:07:12 GMT</pubDate>
    <dc:creator>MR14</dc:creator>
    <dc:date>2024-04-19T13:07:12Z</dc:date>
    <item>
      <title>Append data not appending attributes</title>
      <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688389#M53304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I create a script to append data from feature class in FGDB to SDE (MS Sql DBMS). I use "no_test" on append.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Script works fine, data get appended, but no attributes are transfered, just geometry. When I run the command manually, or if I set target to be another FGDB, it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody experienced this before?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2018 16:21:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688389#M53304</guid>
      <dc:creator>MartinSirkovsky1</dc:creator>
      <dc:date>2018-03-23T16:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Append data not appending attributes</title>
      <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688390#M53305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After you manually run the tool the way it works copy the Python snippet from the Results window and compare the code with what you are using in your script. I'm sure it will contain information on the field mapping.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2018 16:25:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688390#M53305</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-03-23T16:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: Append data not appending attributes</title>
      <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688391#M53306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's probably related to the field mapping from the file geodatabase to the SDE database.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://blogs.esri.com/esri/arcgis/2012/08/30/field-mapping-and-python-scripting/" title="https://blogs.esri.com/esri/arcgis/2012/08/30/field-mapping-and-python-scripting/"&gt;Field mapping and Python scripting | ArcGIS Blog&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As Xander suggests, if you copy the Python snippet from ArcMap it will include the field mapping you need&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.Append_management(&lt;/P&gt;&lt;P&gt;inputs="some featureclass'",&lt;/P&gt;&lt;P&gt;target="some sde",&lt;/P&gt;&lt;P&gt;schema_type="NO_TEST",&lt;/P&gt;&lt;P&gt;field_mapping='a very long string of mapped attributes',&lt;/P&gt;&lt;P&gt;subtype=""&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2018 17:23:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688391#M53306</guid>
      <dc:creator>JustinPierre</dc:creator>
      <dc:date>2018-03-23T17:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: Append data not appending attributes</title>
      <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688392#M53307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think there is a problem in my field mapping. This are the reasons why:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I have copied it from python snippet&lt;/LI&gt;&lt;LI&gt;When I run it against FGDB it works&lt;/LI&gt;&lt;LI&gt;When I run my append code in Python's console in ArcMAP it works (target is SDE)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am wondering if it might be some issue with MS SQL. It is a first time I have experienced such a strange behaviour, and I did append many many times via scripting, however never against MS SQL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2018 19:14:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688392#M53307</guid>
      <dc:creator>MartinSirkovsky1</dc:creator>
      <dc:date>2018-03-23T19:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Append data not appending attributes</title>
      <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688393#M53308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How are you executing your code when not in the interactive Python window in ArcMap?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Mar 2018 20:57:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688393#M53308</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-03-25T20:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Append data not appending attributes</title>
      <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688394#M53309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using Sublime text 3 to execute my code. But I think I also tried directly from command prompt. I did this operation 1000 times before. Please notice, that all the features are appended to target FC, just all attributes have value NULL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Mar 2018 21:27:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688394#M53309</guid>
      <dc:creator>MartinSirkovsky1</dc:creator>
      <dc:date>2018-03-25T21:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Append data not appending attributes</title>
      <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688395#M53310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Martin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What version of ArcGIS are you using, and are there map services consuming the featureclasses that you are attempting to append to??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Mar 2018 23:34:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688395#M53310</guid>
      <dc:creator>MatthewDobson</dc:creator>
      <dc:date>2018-03-25T23:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Append data not appending attributes</title>
      <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688396#M53311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Matthew.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using ArcGIS 10.5.1, and there are currently no Feature Classes consuming the services.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 09:14:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688396#M53311</guid>
      <dc:creator>MartinSirkovsky1</dc:creator>
      <dc:date>2018-03-26T09:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Append data not appending attributes</title>
      <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688397#M53312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I did some testing. Here is something interesting.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have set up the input feature class in a way that I can append it with "TEST"&amp;nbsp;value in "schema_type" parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Running script from ArcMAP both with NO_TEST and TEST as schema type gives correct result&lt;/LI&gt;&lt;LI&gt;Running the script as a python script with NO_TEST as schema type results in FC being appended but no attributes are transfered&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Running the script as a python script with NO_TEST as schema type results in FC being appended&amp;nbsp;together with attributes&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So it seems that there some kind of bug, when running append command from python script with "NO_TEST" as schema type against feature class in MS SQL SDE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Anyone have any idea how to solve this issue?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 09:44:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688397#M53312</guid>
      <dc:creator>MartinSirkovsky1</dc:creator>
      <dc:date>2018-03-26T09:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Append data not appending attributes</title>
      <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688398#M53313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;CORRECTION TO ABOVE POST:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="background-color: #ffffff; border: 0px; font-weight: 400; font-size: 14px; padding: 0px 0px 0px 30px;"&gt;&lt;LI style="border: 0px; font-weight: inherit; font-size: 14px; margin: 0.5ex 0px;"&gt;Running script from ArcMAP both with NO_TEST and TEST as schema type gives correct result&lt;/LI&gt;&lt;LI style="border: 0px; font-weight: inherit; font-size: 14px; margin: 0.5ex 0px;"&gt;Running the script as a python script with NO_TEST as schema type results in FC being appended but no attributes are transfered&lt;/LI&gt;&lt;LI style="border: 0px; font-weight: inherit; font-size: 14px; margin: 0.5ex 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 14px;"&gt;Running the script as a python script with&amp;nbsp;&lt;STRONG&gt;TEST&lt;/STRONG&gt; as schema type results in FC being appended&amp;nbsp;together with attributes&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 09:46:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688398#M53313</guid>
      <dc:creator>MartinSirkovsky1</dc:creator>
      <dc:date>2018-03-26T09:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Append data not appending attributes</title>
      <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688399#M53314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you copy and paste the Python snippet of the code that works in ArcMap?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 11:22:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688399#M53314</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-03-26T11:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Append data not appending attributes</title>
      <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688400#M53315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried that. It doesn't work. And when I run the code it returns no error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you think about it, why would it work if the target FC is FGDB, and not work when the target FC is SDE? And why would it work if the schema type is TEST and not work when the schema type is NO TEST?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems to be that there is some issue with DBMS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 12:03:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688400#M53315</guid>
      <dc:creator>MartinSirkovsky1</dc:creator>
      <dc:date>2018-03-26T12:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Append data not appending attributes</title>
      <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688401#M53316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you wanted to&amp;nbsp;see code and a subset of data I want to import, you can download it from here:&lt;BR /&gt;&lt;A class="link-titled" href="https://www.dropbox.com/s/sh2ugixyxry66fl/sample_code_and_FGDB.zip?dl=1" title="https://www.dropbox.com/s/sh2ugixyxry66fl/sample_code_and_FGDB.zip?dl=0"&gt;Dropbox - sample_code_and_FGDB.zip&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is also here:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;# -*- coding: utf-8 -*-&lt;BR /&gt;#!/usr/bin/python&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;"""&lt;BR /&gt;Script tries to append data to Kloakk SDE (FORSYNING)&lt;/P&gt;&lt;P&gt;The script is testing append command, which appears not to be working&lt;BR /&gt;"""&lt;/P&gt;&lt;P&gt;print "Starting script...."&lt;BR /&gt;import arcpy&lt;/P&gt;&lt;P&gt;inputFC = "C:/temp/kloakk.gdb/kloakk_lutir_180326"&lt;/P&gt;&lt;P&gt;sde = "L:/Forriting/sde connections/gisedit/KLOAK@FORSYNING@tksqlgis.sde/"&lt;BR /&gt;targetFC = "kloakk_lutir_fyribils"&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = sde&lt;/P&gt;&lt;P&gt;fieldMapping = 'mslink "mslink" true true false 4 Long 0 10 ,First,#,kloakk_lutir_180326,mslink,-1,-1;name "navn" true true false 150 Text 0 0 ,First,#,kloakk_lutir_180326,name,-1,-1;city "stað" true true false 50 Text 0 0 ,First,#,kloakk_lutir_180326,city,-1,-1;zip "postnr." true true false 2 Short 0 5 ,First,#,kloakk_lutir_180326,zip,-1,-1;owner "eigari" true true false 2 Text 0 0 ,First,#,kloakk_lutir_180326,owner,-1,-1;liquid "veska" true true false 2 Text 0 0 ,First,#,kloakk_lutir_180326,liquid,-1,-1;feature_type "slag" true true false 2 Short 0 5 ,First,#,kloakk_lutir_180326,feature_type,-1,-1;material "tilfar" true true false 2 Short 0 5 ,First,#,kloakk_lutir_180326,material,-1,-1;net_type "netverkslag" true true false 2 Short 0 5 ,First,#,kloakk_lutir_180326,net_type,-1,-1;diameter "tvørmát" true true false 4 Float 3 6 ,First,#,kloakk_lutir_180326,diameter,-1,-1;elevation_cover "deksulkota" true true false 4 Float 2 6 ,First,#,kloakk_lutir_180326,elevation_cover,-1,-1;elevation_bottom "botnkota" true true false 4 Float 2 6 ,First,#,kloakk_lutir_180326,elevation_bottom,-1,-1;location "staðseting" true true false 2 Short 0 5 ,First,#,kloakk_lutir_180326,location,-1,-1;comment "viðmerking" true true false 200 Text 0 0 ,First,#,kloakk_lutir_180326,comment,-1,-1;construction_year "innlagt ár" true true false 2 Short 0 5 ,First,#,kloakk_lutir_180326,construction_year,-1,-1;status "støða" true true false 2 Short 0 5 ,First,#,kloakk_lutir_180326,status,-1,-1;street_name "gøta" true true false 30 Text 0 0 ,First,#,kloakk_lutir_180326,street_name,-1,-1;house_nr "húsanr." true true false 10 Text 0 0 ,First,#,kloakk_lutir_180326,house_nr,-1,-1;collection_type "mátiháttur" true true false 2 Short 0 5 ,First,#,kloakk_lutir_180326,collection_type,-1,-1;collection_date "skráset dagf." true true false 8 Date 0 0 ,First,#,kloakk_lutir_180326,collection_date,-1,-1;collected_by "skráset hevur" true true false 10 Text 0 0 ,First,#,kloakk_lutir_180326,collected_by,-1,-1;imported_date "innlisið frá microstation" true true false 8 Date 0 0 ,First,#,kloakk_lutir_180326,imported_date,-1,-1'&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;arcpy.Append_management(&lt;BR /&gt; inputs=inputFC,&lt;BR /&gt; target=targetFC,&lt;BR /&gt; schema_type="NO_TEST",&lt;BR /&gt; field_mapping = fieldMapping&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# PYTHON SNIPPET EXPORTED FROM ARCMAP&lt;/P&gt;&lt;P&gt;# # Replace a layer/table view name with a path to a dataset (which can be a layer file) or create the layer/table view within the script&lt;BR /&gt;# # The following inputs are layers or table views: "FORSYNING.KLOAK.kloakk_lutir_fyribils"&lt;BR /&gt;# arcpy.Append_management(inputs="kloakk_lutir_180326", target="FORSYNING.KLOAK.kloakk_lutir_fyribils", schema_type="NO_TEST", field_mapping='mslink "mslink" true true false 4 Long 0 10 ,First,#,kloakk_lutir_180326,mslink,-1,-1;name "navn" true true false 150 Text 0 0 ,First,#,kloakk_lutir_180326,name,-1,-1;city "stað" true true false 50 Text 0 0 ,First,#,kloakk_lutir_180326,city,-1,-1;zip "postnr." true true false 2 Short 0 5 ,First,#,kloakk_lutir_180326,zip,-1,-1;owner "eigari" true true false 2 Text 0 0 ,First,#,kloakk_lutir_180326,owner,-1,-1;liquid "veska" true true false 2 Text 0 0 ,First,#,kloakk_lutir_180326,liquid,-1,-1;feature_type "slag" true true false 2 Short 0 5 ,First,#,kloakk_lutir_180326,feature_type,-1,-1;material "tilfar" true true false 2 Short 0 5 ,First,#,kloakk_lutir_180326,material,-1,-1;net_type "netverkslag" true true false 2 Short 0 5 ,First,#,kloakk_lutir_180326,net_type,-1,-1;diameter "tvørmát" true true false 4 Float 3 6 ,First,#,kloakk_lutir_180326,diameter,-1,-1;elevation_cover "deksulkota" true true false 4 Float 2 6 ,First,#,kloakk_lutir_180326,elevation_cover,-1,-1;elevation_bottom "botnkota" true true false 4 Float 2 6 ,First,#,kloakk_lutir_180326,elevation_bottom,-1,-1;location "staðseting" true true false 2 Short 0 5 ,First,#,kloakk_lutir_180326,location,-1,-1;comment "viðmerking" true true false 200 Text 0 0 ,First,#,kloakk_lutir_180326,comment,-1,-1;construction_year "innlagt ár" true true false 2 Short 0 5 ,First,#,kloakk_lutir_180326,construction_year,-1,-1;status "støða" true true false 2 Short 0 5 ,First,#,kloakk_lutir_180326,status,-1,-1;street_name "gøta" true true false 30 Text 0 0 ,First,#,kloakk_lutir_180326,street_name,-1,-1;house_nr "húsanr." true true false 10 Text 0 0 ,First,#,kloakk_lutir_180326,house_nr,-1,-1;collection_type "mátiháttur" true true false 2 Short 0 5 ,First,#,kloakk_lutir_180326,collection_type,-1,-1;collection_date "skráset dagf." true true false 8 Date 0 0 ,First,#,kloakk_lutir_180326,collection_date,-1,-1;collected_by "skráset hevur" true true false 10 Text 0 0 ,First,#,kloakk_lutir_180326,collected_by,-1,-1;imported_date "innlisið frá microstation" true true false 8 Date 0 0 ,First,#,kloakk_lutir_180326,imported_date,-1,-1', subtype="")&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 13:44:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688401#M53316</guid>
      <dc:creator>MartinSirkovsky1</dc:creator>
      <dc:date>2018-03-26T13:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Append data not appending attributes</title>
      <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688402#M53317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One difference I see between the ArcMap code snippet and your code is that in ArcMap you are passing a layer or table view name whereas you are passing a feature class outside of ArcMap.&amp;nbsp; Although it should not make a difference, have you tried (outside of ArcMap) making a feature layer first and then passing that to Append instead of the feature class directly?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 14:06:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688402#M53317</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-03-26T14:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Append data not appending attributes</title>
      <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688403#M53318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Joshua.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried that as well. No difference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 16:17:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688403#M53318</guid>
      <dc:creator>MartinSirkovsky1</dc:creator>
      <dc:date>2018-03-26T16:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Append data not appending attributes</title>
      <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688404#M53319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got it to work. It is a workaround, and I wish it wouldn't be necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The attributes get appended if I defined the field mappings using a field mapping object, instead&amp;nbsp; of the field mapping definition string which can be found in python snippet.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2018 09:50:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688404#M53319</guid>
      <dc:creator>MartinSirkovsky1</dc:creator>
      <dc:date>2018-03-27T09:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Append data not appending attributes</title>
      <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688405#M53320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;APPEND tool really sucks!&lt;/P&gt;&lt;P&gt;What is a "field mapping object" and how did you create that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2019 20:15:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688405#M53320</guid>
      <dc:creator>CharlesFried</dc:creator>
      <dc:date>2019-03-26T20:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Append data not appending attributes</title>
      <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688406#M53321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can read about field map object here:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/classes/fieldmappings.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/classes/fieldmappings.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;FieldMappings—ArcPy classes | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I have done, I have create a small function where I send the 2 paramters. The first is path to Input feature class, and second is array of arrays of [field name in input FC, corresponding field in target FC]. If the names are the same, I just pass the one item in the subarray.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The functions returns field mapping object, which I then use in append function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a sample from the code, hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Function which created a field mapping object&lt;/SPAN&gt;

&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;def createFieldMap(inputFC, fieldMaps):&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; """&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; Creates a field map object use to define field mapping for tools which use fieldmaps&lt;/SPAN&gt;

&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; Args:&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; inputFC(string): the input feature class&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; fieldMaps(array): array of input / output fields.&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; First item is input field name, second is output field name.&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; If output field name is not defined it is set to same as input field&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; Returns:&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; (object): Field mapping object which can be used to define field mappings&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; """&lt;/SPAN&gt;

&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; # If field out is not defined set it to the same name as field in&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; fms = arcpy.FieldMappings()&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; print ("\nCreating field map")&lt;/SPAN&gt;

&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; for fieldMap in fieldMaps:&lt;/SPAN&gt;

&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; # print ("\nProcessing field {0}".format(fieldMap[0]))&lt;/SPAN&gt;

&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; fieldIn = fieldMap[0]&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; fieldOut = fieldMap[0] if len(fieldMap) == 1 else fieldMap[1]&lt;/SPAN&gt;

&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; # print ("Field in {0}".format(fieldIn))&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; # print ("Field out {0}".format(fieldOut))&lt;/SPAN&gt;


&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; # Define field map&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; fm = arcpy.FieldMap()&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; fm.addInputField(inputFC, fieldIn)&lt;/SPAN&gt;

&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; # Set ouput field properties&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; fmOutputField = fm.outputField&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; fmOutputField.name = fieldOut&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; fm.outputField = fmOutputField&lt;/SPAN&gt;

&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; fms.addFieldMap(fm)&lt;/SPAN&gt;

&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; return fms&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;fms = createFieldMap(
&amp;nbsp; pathToinputFC, 
&amp;nbsp; [
&amp;nbsp; &amp;nbsp; ['feature_id', 'id'], # values from input FC field "feature_id" will be appended to field in target FC with name "id"
&amp;nbsp; &amp;nbsp; ['owner'], # the name of the field in input and target FC is save, "owner"
&amp;nbsp; &amp;nbsp; ['liquid'] # the name of the field in input and target FC is save, "liquid"
&amp;nbsp; ],
)


# RUN Append command
arcpy.Append_management(
&amp;nbsp; inputs=pathToinputFC,
&amp;nbsp; target=targetFC,
&amp;nbsp; schema_type="NO_TEST",
&amp;nbsp; field_mapping = fms
)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:48:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/688406#M53321</guid>
      <dc:creator>MartinSirkovsky1</dc:creator>
      <dc:date>2021-12-12T16:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Append data not appending attributes</title>
      <link>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/1412206#M70380</link>
      <description>&lt;P&gt;Thanks Martin! Using a field mapping object was the only working solution for appending to an sde feature class&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 13:07:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/append-data-not-appending-attributes/m-p/1412206#M70380</guid>
      <dc:creator>MR14</dc:creator>
      <dc:date>2024-04-19T13:07:12Z</dc:date>
    </item>
  </channel>
</rss>

