<?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 Merge FGDB Feature Class with AGOL Hosted Feature Layer in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/merge-fgdb-feature-class-with-agol-hosted-feature/m-p/1088633#M6488</link>
    <description>&lt;P&gt;I'm trying to overwrite a hosted feature layer using a FGDB Feature Class. I've tried a couple things. First, I've tried merging the two.&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcgis
from arcgis.gis import GIS

gis = GIS('Home')
fl = gis.content.get('item id goes here')
layer_to_merge = r'C:\Users\jpilbeam\Default.gdb\firstdose_test'

arcgis.features.analysis.merge_layers(fl, layer_to_merge)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Exception: Job failed.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;2 Using &lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/using-python-api-to-update-a-hosted-feature-layer/m-p/807034#M2319" target="_self"&gt;this post&lt;/A&gt; as an example, I tried overwriting the hosted feature layer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import os, sys, arcpy
from arcgis.gis import GIS
source = GIS('Home', verify_cert=False)
layer = source.content.get('itemID goes here')

layer.update({}, r'C:\Users\jpilbeam\Default.gdb\firstdose_test')
layer.publish(overwrite=True, file_type='fileGeodatabase')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Exception: Invalid JSON in 'text' parameter.
(Error Code: 400)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Aug 2021 20:44:31 GMT</pubDate>
    <dc:creator>JaredPilbeam2</dc:creator>
    <dc:date>2021-08-12T20:44:31Z</dc:date>
    <item>
      <title>Merge FGDB Feature Class with AGOL Hosted Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/merge-fgdb-feature-class-with-agol-hosted-feature/m-p/1088633#M6488</link>
      <description>&lt;P&gt;I'm trying to overwrite a hosted feature layer using a FGDB Feature Class. I've tried a couple things. First, I've tried merging the two.&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcgis
from arcgis.gis import GIS

gis = GIS('Home')
fl = gis.content.get('item id goes here')
layer_to_merge = r'C:\Users\jpilbeam\Default.gdb\firstdose_test'

arcgis.features.analysis.merge_layers(fl, layer_to_merge)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Exception: Job failed.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;2 Using &lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/using-python-api-to-update-a-hosted-feature-layer/m-p/807034#M2319" target="_self"&gt;this post&lt;/A&gt; as an example, I tried overwriting the hosted feature layer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import os, sys, arcpy
from arcgis.gis import GIS
source = GIS('Home', verify_cert=False)
layer = source.content.get('itemID goes here')

layer.update({}, r'C:\Users\jpilbeam\Default.gdb\firstdose_test')
layer.publish(overwrite=True, file_type='fileGeodatabase')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Exception: Invalid JSON in 'text' parameter.
(Error Code: 400)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 20:44:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/merge-fgdb-feature-class-with-agol-hosted-feature/m-p/1088633#M6488</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-08-12T20:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Merge FGDB Feature Class with AGOL Hosted Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/merge-fgdb-feature-class-with-agol-hosted-feature/m-p/1091586#M6528</link>
      <description>&lt;P&gt;I have done this in the past with great success.&lt;/P&gt;&lt;P&gt;I used the feature layer collection manager class&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
from arcgis.features import FeatureLayerCollection

item =  gis.content('itemid')

FLC = FeatureLayerCollection.fromitem(item)

FLC.manager.overwrite('Your file')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.managers.html#arcgis.features.managers.FeatureLayerCollectionManager.overwrite" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/arcgis.features.managers.html#arcgis.features.managers.FeatureLayerCollectionManager.overwrite&lt;/A&gt;&lt;/P&gt;&lt;P&gt;File/table/layer /field names have to match.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 05:05:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/merge-fgdb-feature-class-with-agol-hosted-feature/m-p/1091586#M6528</guid>
      <dc:creator>PeterMilenkovic</dc:creator>
      <dc:date>2021-08-24T05:05:48Z</dc:date>
    </item>
  </channel>
</rss>

