<?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: Service Definition or File Geodatabase for publishing a hosted feature layer to AGOL? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/service-definition-or-file-geodatabase-for/m-p/1543742#M10720</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/420216"&gt;@MaryGraceMcClellan&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Here is how I would approach this if I had access to ArcGIS Pro and ArcPy and avoiding the use of the ArcGIS API for Python.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create an APRX and save it.&lt;/LI&gt;&lt;LI&gt;Use ArcPy to access the APRX (arcpy.mp.ArcGISProject())&lt;/LI&gt;&lt;LI&gt;Use ArcPy to iterate through each feature class in the geodatabase (arcpy.ListFeatureClasses())&lt;UL&gt;&lt;LI&gt;On each iteration, for each fc, add it to Map&lt;/LI&gt;&lt;LI&gt;Publish that layer to ArcGIS Online (see code &lt;A href="https://learn.finaldraftmapping.com/publish-a-hosted-feature-service-to-arcgis-online-from-arcgis-pro-using-arcpy/" target="_blank" rel="noopener"&gt;here&lt;/A&gt; to help)&lt;/LI&gt;&lt;LI&gt;Remove layer from the map.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This will go through all feature classes in the gdb and publish each one individually to ArcGIS Online (or Portal) as Hosted Feature Services. You will need to define the name of the Feature Service on each iteration which can simply be the name of the feature class itself.&lt;/P&gt;&lt;P&gt;You can use the same workflow with some minor tweaks to overwrite the feature services too should the need/want arise&lt;/P&gt;</description>
    <pubDate>Mon, 30 Sep 2024 09:26:32 GMT</pubDate>
    <dc:creator>Clubdebambos</dc:creator>
    <dc:date>2024-09-30T09:26:32Z</dc:date>
    <item>
      <title>Service Definition or File Geodatabase for publishing a hosted feature layer to AGOL?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/service-definition-or-file-geodatabase-for/m-p/1477139#M10064</link>
      <description>&lt;P&gt;I have a file geodatabase with 100 layers in it. I want each layer to be its own item in AGOL and I'm trying to write a script that will automatically publish them to AGOL. (The hope is I can re-use this later)&lt;/P&gt;&lt;P&gt;I've seen a couple of different methods for publishing layers to AGOL. The one I'm using now uses something like the following code:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# feature class has been exported to its own GDB
# new gdb has been compressed to a .zip file

item = gis.content.add(path to zipped GDB)
published_item = item.publish(overwrite=True)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is&amp;nbsp; resulting in a "Job failed" error and I don't understand why. I've seen that it's possible to use a service definition, but I only want the hosted feature and I don't care about having a map service. Is the service definition method the only way to actually accomplish what I want to do?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 17:49:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/service-definition-or-file-geodatabase-for/m-p/1477139#M10064</guid>
      <dc:creator>MaryGraceMcClellan</dc:creator>
      <dc:date>2024-05-22T17:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: Service Definition or File Geodatabase for publishing a hosted feature layer to AGOL?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/service-definition-or-file-geodatabase-for/m-p/1543742#M10720</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/420216"&gt;@MaryGraceMcClellan&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Here is how I would approach this if I had access to ArcGIS Pro and ArcPy and avoiding the use of the ArcGIS API for Python.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create an APRX and save it.&lt;/LI&gt;&lt;LI&gt;Use ArcPy to access the APRX (arcpy.mp.ArcGISProject())&lt;/LI&gt;&lt;LI&gt;Use ArcPy to iterate through each feature class in the geodatabase (arcpy.ListFeatureClasses())&lt;UL&gt;&lt;LI&gt;On each iteration, for each fc, add it to Map&lt;/LI&gt;&lt;LI&gt;Publish that layer to ArcGIS Online (see code &lt;A href="https://learn.finaldraftmapping.com/publish-a-hosted-feature-service-to-arcgis-online-from-arcgis-pro-using-arcpy/" target="_blank" rel="noopener"&gt;here&lt;/A&gt; to help)&lt;/LI&gt;&lt;LI&gt;Remove layer from the map.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This will go through all feature classes in the gdb and publish each one individually to ArcGIS Online (or Portal) as Hosted Feature Services. You will need to define the name of the Feature Service on each iteration which can simply be the name of the feature class itself.&lt;/P&gt;&lt;P&gt;You can use the same workflow with some minor tweaks to overwrite the feature services too should the need/want arise&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 09:26:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/service-definition-or-file-geodatabase-for/m-p/1543742#M10720</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2024-09-30T09:26:32Z</dc:date>
    </item>
  </channel>
</rss>

