<?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>idea Please maintain attachments when using the append method (ArcGIS API for Python) on a hosted feature layer. in ArcGIS API for Python Ideas</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-ideas/please-maintain-attachments-when-using-the-append/idi-p/1246160</link>
    <description>&lt;P&gt;Please maintain attachments when using the append method on a hosted feature layer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When following these instructions:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-online/data-management/keeping-layers-updated-by-appending-features-using-the-arcgis-api-for-python/" target="_blank" rel="noopener"&gt;https://www.esri.com/arcgis-blog/products/arcgis-online/data-management/keeping-layers-updated-by-appending-features-using-the-arcgis-api-for-python/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Append does not maintain attachments that are located in the hosted file geodatabase.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Jan 2023 17:26:17 GMT</pubDate>
    <dc:creator>ZacharyNeumannQK</dc:creator>
    <dc:date>2023-01-10T17:26:17Z</dc:date>
    <item>
      <title>Please maintain attachments when using the append method (ArcGIS API for Python) on a hosted feature layer.</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-ideas/please-maintain-attachments-when-using-the-append/idi-p/1246160</link>
      <description>&lt;P&gt;Please maintain attachments when using the append method on a hosted feature layer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When following these instructions:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-online/data-management/keeping-layers-updated-by-appending-features-using-the-arcgis-api-for-python/" target="_blank" rel="noopener"&gt;https://www.esri.com/arcgis-blog/products/arcgis-online/data-management/keeping-layers-updated-by-appending-features-using-the-arcgis-api-for-python/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Append does not maintain attachments that are located in the hosted file geodatabase.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 17:26:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-ideas/please-maintain-attachments-when-using-the-append/idi-p/1246160</guid>
      <dc:creator>ZacharyNeumannQK</dc:creator>
      <dc:date>2023-01-10T17:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Please maintain attachments when using the append method on a hosted feature layer.</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-ideas/please-maintain-attachments-when-using-the-append/idc-p/1246319#M35</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/582659"&gt;@ZacharyNeumannQK&lt;/a&gt;&amp;nbsp;not sure if this is an idea, because you can select "Maintain Attachments" in the environment variables for Append&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2023 15:43:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-ideas/please-maintain-attachments-when-using-the-append/idc-p/1246319#M35</guid>
      <dc:creator>David_Brooks</dc:creator>
      <dc:date>2023-01-08T15:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Please maintain attachments when using the append method on a hosted feature layer.</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-ideas/please-maintain-attachments-when-using-the-append/idc-p/1246888#M36</link>
      <description>&lt;P&gt;This is specifically for the ArcGIS API for Python. You cannot set that in an environment variable for the API... Unless you know something I don't know.&lt;/P&gt;&lt;P&gt;See Reference:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.html#arcgis.features.FeatureLayer.append" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/arcgis.features.html#arcgis.features.FeatureLayer.append&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 17:25:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-ideas/please-maintain-attachments-when-using-the-append/idc-p/1246888#M36</guid>
      <dc:creator>ZacharyNeumannQK</dc:creator>
      <dc:date>2023-01-10T17:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Please maintain attachments when using the append method (ArcGIS API for Python) on a hosted feature layer.</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-ideas/please-maintain-attachments-when-using-the-append/idc-p/1275396#M62</link>
      <description>&lt;P&gt;Second this idea! Unable to find way to maintain attachments. Looking to script adding attachments after append-but why the workaround for this?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 18:04:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-ideas/please-maintain-attachments-when-using-the-append/idc-p/1275396#M62</guid>
      <dc:creator>BE4</dc:creator>
      <dc:date>2023-04-04T18:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: Please maintain attachments when using the append method (ArcGIS API for Python) on a hosted feature layer.</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-ideas/please-maintain-attachments-when-using-the-append/idc-p/1275398#M63</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def add_attachments(survey_monuments_fl, attach_table):
    
    df = pd.read_csv(attach_table)
    
    for s in zip(df['Path'], df['GlobalID']):
        if not type(s[0]) == float: # make sure path is not empty
            attach_path = os.path.join(project_folder_path, s[0])
            globalid = s[1]
            feature = survey_monuments_fl.query(where=f"GLOBAL_TEXT = '{globalid}'")
            objectid = feature.value['features'][0]['attributes']['OBJECTID']
            objectid = int(objectid)

            update(f"Adding attachment {attach_path} to {objectid}")
            survey_monuments_fl.attachments.add(objectid, attach_path)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;Idk if this is helpful but I used this to add attachments after appending an item to the FL.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;And yes, I agree. It's a super annoying work around and does not make any sense as why attachments don't maintain or no option in the api.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;pd is pandas (I am sure you know that though).&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Attach table&amp;nbsp;has Path like this. I don't have the full path because of some kind of ESRI documentation I forget where&lt;/DIV&gt;&lt;DIV&gt;&lt;TABLE width="246"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="246"&gt;files\win_20211007_09_30_26_pro.jpg&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and GlobalID&lt;/P&gt;&lt;TABLE width="288"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="288"&gt;GlobalID&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;{09804DA6-F682-48CA-8107-4X8102E16A54}&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also needed to save GlobalID as a text field in the Feature Layer I am pretty sure because Esri likes to change those.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how I made the fl object&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;itemid = #itemidhere
survey_monuments_item = gis.content.get(f"{itemid}")
survey_monuments_fl = survey_monuments_item.layers[0]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 18:22:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-ideas/please-maintain-attachments-when-using-the-append/idc-p/1275398#M63</guid>
      <dc:creator>ZacharyNeumannQK</dc:creator>
      <dc:date>2023-04-04T18:22:43Z</dc:date>
    </item>
  </channel>
</rss>

