<?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() takes no keyword arguments in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/append-takes-no-keyword-arguments/m-p/1049517#M5952</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/114953"&gt;@JoeWaters1&lt;/a&gt;&amp;nbsp;, I ultimately decided to run the Append tool from ArcGIS Pro on my AGO layers. The work I was doing didn't require using the Python API, so using the Append tool from Pro worked as an alternative for me.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Apr 2021 12:22:22 GMT</pubDate>
    <dc:creator>pmccord</dc:creator>
    <dc:date>2021-04-21T12:22:22Z</dc:date>
    <item>
      <title>Append() takes no keyword arguments</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/append-takes-no-keyword-arguments/m-p/1026353#M5544</link>
      <description>&lt;P&gt;I'm pretty new to the ArcGIS API for Python. I'm trying to use the Append function to append data from a source file geodatabase that is hosted on AGO to a target feature layer. I'm using the upsert parameter because, not only am I adding additional features to the target from the source, but I've also changed some of the attributes within the source and I want those changes reflected in the target.&lt;/P&gt;&lt;P&gt;What I'm trying to do is pretty basic I think, but when I run my script I get the message "append() takes no keyword arguments".&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my code:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import os

from arcgis.gis import GIS


# Create a GIS connection to AGO where the test data is located
gis = GIS(url, username, password)

# Target feature layer (feature layer with fewer points that needs to be updated)
target_item = gis.content.get("1fbf6a4e1ebe4720aa7036a3d52f7544")
print("feature layer to update:", target_item)
target_lyr = target_item.layers

# Look for the unique field within the target layer
# simply verifies that I had a field with unique values in my target layer
"""
uk_flds = (f.fields for f in target_lyr[0].properties.indexes if f.isUnique)
for fld in target_lyr[0].properties.fields:
    if fld.name in uk_flds:
        print(f"{fld.name:30}{fld.type:25}isUnique")
    else:
        print(f"{fld.name:30}{fld.type:25}")
"""

# Source fgdb
src_lyr = gis.content.search("Water_system_valves_source")[0]
print(src_lyr)

# Run the Append function
target_lyr.append(
    source_table_name="test",
    item_id=src_lyr.id,
    upload_format="filegdb",
    upsert=True,
    skip_updates=False,
    use_globalids=False,
    update_geometry=True,
    append_fields=["FID", "VALVETYPE", "Creator"],
    rollback=False,
    skip_inserts=False,
    upsert_matching_field="FID",
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The field with unique values that matches records between the two layers is "FID." I specified "FID", "VALVETYPE", and "Creator" in the append_fields parameter because VALVETYPE and Creator are the two fields where attribute values were changed in the source dataset. FID was specified because it is the unique identifier (I'm not sure if this is correct, but it's what I took away from some of the documentation). All of the fields are the same between the source and target layers, but they're in a slightly different order.&lt;/P&gt;&lt;P&gt;I primarily followed this resource:&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/guide/appending-features/" target="_blank"&gt;https://developers.arcgis.com/python/guide/appending-features/&lt;/A&gt;&amp;nbsp;(starting at the "&lt;SPAN&gt;Insert New Features and Update Existing Features - Upsert" section).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Any assistance would be appreciated. Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 16:56:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/append-takes-no-keyword-arguments/m-p/1026353#M5544</guid>
      <dc:creator>pmccord</dc:creator>
      <dc:date>2021-02-12T16:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: Append() takes no keyword arguments</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/append-takes-no-keyword-arguments/m-p/1026366#M5545</link>
      <description>&lt;P&gt;I've not utilised this before, but if you're appending to a specific layer, wouldn't you need to reference an individual layer e.g.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;target_lyr = target_item.layers[0]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 17:15:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/append-takes-no-keyword-arguments/m-p/1026366#M5545</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-02-12T17:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Append() takes no keyword arguments</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/append-takes-no-keyword-arguments/m-p/1026688#M5553</link>
      <description>&lt;P&gt;Thank you David, you were right that I needed to alter the code to read:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;target_lyr = target_item.layers[0]&lt;/LI-CODE&gt;&lt;P&gt;I'm now getting an error of &lt;SPAN&gt;"Object reference not set to an instance of an object". My understanding is that this might be a field mappings issue between the source and target layers. I'm going to look into this a bit more and post any solution I find.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I believe that my fields are identical between the two layers, but I need to inspect it further.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Feb 2021 19:31:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/append-takes-no-keyword-arguments/m-p/1026688#M5553</guid>
      <dc:creator>pmccord</dc:creator>
      <dc:date>2021-02-14T19:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Append() takes no keyword arguments</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/append-takes-no-keyword-arguments/m-p/1049202#M5942</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/413690"&gt;@pmccord&lt;/a&gt;&amp;nbsp;did you get this working? I am running into the same error and am wondering if you found a solution.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 15:52:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/append-takes-no-keyword-arguments/m-p/1049202#M5942</guid>
      <dc:creator>JoeWaters1</dc:creator>
      <dc:date>2021-04-20T15:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Append() takes no keyword arguments</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/append-takes-no-keyword-arguments/m-p/1049517#M5952</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/114953"&gt;@JoeWaters1&lt;/a&gt;&amp;nbsp;, I ultimately decided to run the Append tool from ArcGIS Pro on my AGO layers. The work I was doing didn't require using the Python API, so using the Append tool from Pro worked as an alternative for me.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 12:22:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/append-takes-no-keyword-arguments/m-p/1049517#M5952</guid>
      <dc:creator>pmccord</dc:creator>
      <dc:date>2021-04-21T12:22:22Z</dc:date>
    </item>
  </channel>
</rss>

