<?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 Add new Feature Layer to an existing Collection in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-new-feature-layer-to-an-existing-collection/m-p/1005665#M5256</link>
    <description>&lt;P&gt;I want to add a new Feature Layer to an existing&amp;nbsp;Feature Layer Collection (FLC) that I am already successfully overwriting daily using code like:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;feature_layer_collection = FeatureLayerCollection.fromitem(dataitem) 
feature_layer_collection.manager.overwrite(zipped_gdb)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, this requires that the new zipped gdb contain the exact structure of Feature Layers as the existing FLC being overwritten. &lt;STRONG&gt;How do I add a new layer into the FLC so that upon the next overwrite which includes the additional Feature Layer, it won't result in an error? &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This FLC contains 6 Feature Layers that are being used in published maps, so I do not want to simply create a new FLC with the additional layer since I would then have to reconfigure all the published maps.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Nov 2020 21:22:39 GMT</pubDate>
    <dc:creator>RichThomas2</dc:creator>
    <dc:date>2020-11-30T21:22:39Z</dc:date>
    <item>
      <title>Add new Feature Layer to an existing Collection</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-new-feature-layer-to-an-existing-collection/m-p/1005665#M5256</link>
      <description>&lt;P&gt;I want to add a new Feature Layer to an existing&amp;nbsp;Feature Layer Collection (FLC) that I am already successfully overwriting daily using code like:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;feature_layer_collection = FeatureLayerCollection.fromitem(dataitem) 
feature_layer_collection.manager.overwrite(zipped_gdb)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, this requires that the new zipped gdb contain the exact structure of Feature Layers as the existing FLC being overwritten. &lt;STRONG&gt;How do I add a new layer into the FLC so that upon the next overwrite which includes the additional Feature Layer, it won't result in an error? &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This FLC contains 6 Feature Layers that are being used in published maps, so I do not want to simply create a new FLC with the additional layer since I would then have to reconfigure all the published maps.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 21:22:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/add-new-feature-layer-to-an-existing-collection/m-p/1005665#M5256</guid>
      <dc:creator>RichThomas2</dc:creator>
      <dc:date>2020-11-30T21:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Add new Feature Layer to an existing Collection</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-new-feature-layer-to-an-existing-collection/m-p/1005678#M5257</link>
      <description>&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;Try using the Add to Definition method to add an additional feature layer to your hosted feature service:&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.managers.html?highlight=add%20definition#arcgis.features.managers.FeatureLayerCollectionManager" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/arcgis.features.managers.html?highlight=add%20definition#arcgis.features.managers.FeatureLayerCollectionManager&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Does this have what you need?&lt;/P&gt;&lt;P&gt;-Calvin&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 22:01:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/add-new-feature-layer-to-an-existing-collection/m-p/1005678#M5257</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-11-30T22:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Add new Feature Layer to an existing Collection</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-new-feature-layer-to-an-existing-collection/m-p/1006504#M5263</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/382659"&gt;@RichThomas2&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;If you do a truncate on the feature layer first then overwrite the feature layer collection, it should work.&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
gis = GIS("url", "username", "password")

# get the feature layer
flc_item = gis.content.get("item_id")
fLyr = flc_item.layers[0]
fLyr.manager.truncate()

# get the gdb item
gdb_item = gis.content.get("gdb_item_id")

feature_layer_collection = FeatureLayerCollection.fromitem(flc_item)
feature_layer_collection.manager.overwrite(gdb_item)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MehdiPira1_0-1606961698497.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/1399iEEB95FA0F3B83F2F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MehdiPira1_0-1606961698497.png" alt="MehdiPira1_0-1606961698497.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I hope that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 02:17:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/add-new-feature-layer-to-an-existing-collection/m-p/1006504#M5263</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2020-12-03T02:17:55Z</dc:date>
    </item>
  </channel>
</rss>

