<?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: Use Folder.add function and wait ArcGIS Python API in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/use-folder-add-function-and-wait-arcgis-python-api/m-p/1596566#M11233</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/594310"&gt;@DavidHanimann&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I just use the below.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;## the .result() will return an item object representing the added gdb
item_obj = folder.add(item_properties, gdb_path).result()

# do whatever you need to the content item object, for example publish (which in-turn returns another itehm object - a Feature Service [FeatureLayerCollection]) 

another_item_obj = item_obj.publish()

# do whatever you need on the published item, add to groups, update symbology/popups, add to a WebMap etc&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have iterated over tens of zipped datasets for upload (add) and publishing and adding to folders, groups, adding symbology/popups/labels etc without any issues.&lt;/P&gt;&lt;P&gt;I hope that helps,&lt;/P&gt;&lt;P&gt;Glen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Mar 2025 14:28:10 GMT</pubDate>
    <dc:creator>Clubdebambos</dc:creator>
    <dc:date>2025-03-18T14:28:10Z</dc:date>
    <item>
      <title>Use Folder.add function and wait ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/use-folder-add-function-and-wait-arcgis-python-api/m-p/1596504#M11232</link>
      <description>&lt;P&gt;I am trying to add a FeatureService to a folder in ArcGIS Online using the Python APIs Folder.add() method.&lt;/P&gt;&lt;P&gt;This method returns a Future. How can I wait for this to finish and execute the remainder of the script synchronously? The only way I found was with a while loop, which is not nice.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    item_properties = {
        "title": "Test Feature Service",
        "tags": "example, feature service",
        "type": "File Geodatabase",
    }
    gdb_path = r"Default.gdb.zip"
    folder = login.content.folders.get(folder="My_Folder", owner="my-username")
    add_job = folder.add(item_properties, gdb_path)
    while True:
        if add_job.done():
            result = add_job.result()
            break
    print(result)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2025 12:37:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/use-folder-add-function-and-wait-arcgis-python-api/m-p/1596504#M11232</guid>
      <dc:creator>DavidHanimann</dc:creator>
      <dc:date>2025-03-18T12:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Use Folder.add function and wait ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/use-folder-add-function-and-wait-arcgis-python-api/m-p/1596566#M11233</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/594310"&gt;@DavidHanimann&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I just use the below.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;## the .result() will return an item object representing the added gdb
item_obj = folder.add(item_properties, gdb_path).result()

# do whatever you need to the content item object, for example publish (which in-turn returns another itehm object - a Feature Service [FeatureLayerCollection]) 

another_item_obj = item_obj.publish()

# do whatever you need on the published item, add to groups, update symbology/popups, add to a WebMap etc&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have iterated over tens of zipped datasets for upload (add) and publishing and adding to folders, groups, adding symbology/popups/labels etc without any issues.&lt;/P&gt;&lt;P&gt;I hope that helps,&lt;/P&gt;&lt;P&gt;Glen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2025 14:28:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/use-folder-add-function-and-wait-arcgis-python-api/m-p/1596566#M11233</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2025-03-18T14:28:10Z</dc:date>
    </item>
  </channel>
</rss>

