<?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: Appending data to Feature Service via arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/appending-data-to-feature-service-via-arcpy/m-p/1538846#M72859</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/148829"&gt;@LindsayRaabe_FPCWA&lt;/a&gt;,&amp;nbsp;for the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/append.htm" target="_self"&gt;matching_fields&lt;/A&gt; option, are you using this parameter to update existing features?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JakeSkinner_0-1726490419402.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/115153i2AF5A3D95D8BD1FF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JakeSkinner_0-1726490419402.png" alt="JakeSkinner_0-1726490419402.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Sep 2024 12:40:25 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2024-09-16T12:40:25Z</dc:date>
    <item>
      <title>Appending data to Feature Service via arcpy</title>
      <link>https://community.esri.com/t5/python-questions/appending-data-to-feature-service-via-arcpy/m-p/1538784#M72858</link>
      <description>&lt;P&gt;Hi Brains Trust. I've given up trying to figure this out on my own. I know that the arcpy Append GP tool will normally let me append data from a feature class to a feature service. However, when running the below code I keep getting the error displayed. Can anyone give me any pointers? I've tried working with Copilot, and also with different methods (e.g. da.updatecursor) but that doesn't work with feature services.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Step 9: Compare and update Post_Planting_Inspection_Tracking_Base
print("Step 9: Comparing and updating Post_Planting_Inspection_Tracking_Base...")
arcpy.management.Append(
    inputs=update_data,
    target=post_planting_layer,
    schema_type="NO_TEST",
    field_mapping=r'Plantation "Plantation" true true false 50 Text 0 0,First,#,C:\temp\scratch.gdb\update_data,Plantation,0,50;Forest "Forest ID" true true false 6 Text 0 0,First,#,C:\temp\scratch.gdb\update_data,Forest,0,6;Species "Species" true true false 20 Text 0 0,First,#,C:\temp\scratch.gdb\update_data,Species,0,20;PlantingYear "Planting Year" true true false 0 Long 0 0,First,#,C:\temp\scratch.gdb\update_data,PlantingYear,-1,-1;RENDER_LABEL "Tenure" true true false 255 Text 0 0,First,#,C:\temp\scratch.gdb\update_data,RENDER_LABEL,0,50;PlantingFinished "Planting Finished" true true false 0 Date 0 0,First,#,update_data,MAX_FinishDate,-1,-1',
    subtype="",
    expression="",
    match_fields="Plantation Plantation;Forest Forest;Species Species;PlantingYear PlantingYear;PlantingFinished MAX_FinishDate;RENDER_LABEL RENDER_LABEL",
    update_geometry="UPDATE_GEOMETRY"
)
print("Features added/updated - process complete!")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;Step 9: Comparing and updating Post_Planting_Inspection_Tracking_Base...&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;Traceback (most recent call last):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;File "C:\Temp\Upload FPC416 Polygons.py", line 130, in &amp;lt;module&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;arcpy.management.Append(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 7306, in Append&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;raise e&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 7303, in Append&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;retval = convertArcObjectToPythonObject(gp.Append_management(*gp_fixargs((inputs, target, schema_type, field_mapping, subtype, expression, match_fields, update_geometry), True)))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in &amp;lt;lambda&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;return lambda *args: val(*gp_fixargs(args, True))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;RuntimeError: Object: Error in executing tool&lt;/FONT&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 16 Sep 2024 06:09:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/appending-data-to-feature-service-via-arcpy/m-p/1538784#M72858</guid>
      <dc:creator>LindsayRaabe_FPCWA</dc:creator>
      <dc:date>2024-09-16T06:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: Appending data to Feature Service via arcpy</title>
      <link>https://community.esri.com/t5/python-questions/appending-data-to-feature-service-via-arcpy/m-p/1538846#M72859</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/148829"&gt;@LindsayRaabe_FPCWA&lt;/a&gt;,&amp;nbsp;for the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/append.htm" target="_self"&gt;matching_fields&lt;/A&gt; option, are you using this parameter to update existing features?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JakeSkinner_0-1726490419402.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/115153i2AF5A3D95D8BD1FF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JakeSkinner_0-1726490419402.png" alt="JakeSkinner_0-1726490419402.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 12:40:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/appending-data-to-feature-service-via-arcpy/m-p/1538846#M72859</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2024-09-16T12:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Appending data to Feature Service via arcpy</title>
      <link>https://community.esri.com/t5/python-questions/appending-data-to-feature-service-via-arcpy/m-p/1539811#M72891</link>
      <description>&lt;P&gt;Hi Jake. Yes, I believe I have (I am at least meant to have) the Update option enabled (including Geometry). I don't want duplicate records being created. Is there something missing in my code that should be there? From what I can see in the documentation, I have all parameters accounted for.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 03:46:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/appending-data-to-feature-service-via-arcpy/m-p/1539811#M72891</guid>
      <dc:creator>LindsayRaabe_FPCWA</dc:creator>
      <dc:date>2024-09-18T03:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Appending data to Feature Service via arcpy</title>
      <link>https://community.esri.com/t5/python-questions/appending-data-to-feature-service-via-arcpy/m-p/1539814#M72892</link>
      <description>&lt;P&gt;Turns out the problem was the target "layer". I was converting my target feature service URL into a feature layer using the below command and that was the target. When I changed the target to the URL parameter, it worked! Now to figure out why the field mapping isn't working and my data is coming in with blank attributes!&lt;/P&gt;&lt;LI-CODE lang="python"&gt;post_planting_url = "https://services-ap1.arcgis.com/xyzxyzxyzxyzx/arcgis/rest/services/My_Feature_Service/FeatureServer/0"

post_planting_layer = FeatureLayer(post_planting_url)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 18 Sep 2024 04:02:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/appending-data-to-feature-service-via-arcpy/m-p/1539814#M72892</guid>
      <dc:creator>LindsayRaabe_FPCWA</dc:creator>
      <dc:date>2024-09-18T04:02:07Z</dc:date>
    </item>
  </channel>
</rss>

