<?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 to Feature Layer Collection in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/append-to-feature-layer-collection/m-p/1415641#M9942</link>
    <description>&lt;P&gt;I have better better luck converting the dataframe to a featureset first. Try this for your final line:&lt;/P&gt;&lt;P&gt;flayer.edit_features(adds = sdf.spatial.to_featureset())&lt;/P&gt;</description>
    <pubDate>Thu, 25 Apr 2024 23:03:50 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2024-04-25T23:03:50Z</dc:date>
    <item>
      <title>Append to Feature Layer Collection</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/append-to-feature-layer-collection/m-p/1415632#M9941</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;My environment is ArcGIS Enterprise v11.1 &amp;amp; ArcGIS Pro v3.2.1.&lt;/P&gt;&lt;P&gt;I can successfully append from a shapefile to a hosted feature layer in Portal.&amp;nbsp; The new points come over, but the attributes are blank.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# initial imports&lt;/EM&gt;&lt;BR /&gt;from IPython.display import display, HTML&lt;BR /&gt;from arcgis.features import FeatureLayerCollection&lt;BR /&gt;from arcgis.gis import GIS&lt;BR /&gt;import pandas as pd&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# connect to GIS&lt;/EM&gt;&lt;BR /&gt;gis = GIS("home")&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# set a variable for the source .shp&lt;/EM&gt;&lt;BR /&gt;src_table = r"C:\Data\orbs.shp"&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# Read the shapefile using Spatially Enabled DataFrame&lt;/EM&gt;&lt;BR /&gt;sdf = pd.DataFrame.spatial.from_featureclass(src_table)&lt;BR /&gt;sdf&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# Get the item to append to (target)&lt;/EM&gt;&lt;BR /&gt;item = gis.content.get("07bbd53a0efu413193fcb511c6dcb4d5")&lt;BR /&gt;flayer = item.layers[0] &lt;EM&gt;# first item in the FeatureLayerCollection&lt;/EM&gt;&lt;BR /&gt;item&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# confirming the first item in the collection&lt;/EM&gt;&lt;BR /&gt;print(flayer)&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# append&lt;/EM&gt;&lt;BR /&gt;flayer.edit_features(adds = sdf)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any assistance you can provide is greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 22:38:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/append-to-feature-layer-collection/m-p/1415632#M9941</guid>
      <dc:creator>John_Herrera</dc:creator>
      <dc:date>2024-04-25T22:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: Append to Feature Layer Collection</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/append-to-feature-layer-collection/m-p/1415641#M9942</link>
      <description>&lt;P&gt;I have better better luck converting the dataframe to a featureset first. Try this for your final line:&lt;/P&gt;&lt;P&gt;flayer.edit_features(adds = sdf.spatial.to_featureset())&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 23:03:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/append-to-feature-layer-collection/m-p/1415641#M9942</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2024-04-25T23:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Append to Feature Layer Collection</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/append-to-feature-layer-collection/m-p/1415985#M9951</link>
      <description>&lt;P&gt;This worked!&amp;nbsp; Thank you for your time!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 17:48:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/append-to-feature-layer-collection/m-p/1415985#M9951</guid>
      <dc:creator>John_Herrera</dc:creator>
      <dc:date>2024-04-26T17:48:18Z</dc:date>
    </item>
  </channel>
</rss>

