<?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 Append data from csv to hosted table using Python API in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/append-data-from-csv-to-hosted-table-using-python/m-p/664978#M33161</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to append data to a hosted Table from a csv file using the Python API.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This can be done in AGOL, by choosing Update Data -&amp;gt; Append data to layer, how would that be done in Python.&lt;/P&gt;&lt;P&gt;I've tried to follow this:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/python/guide/appending-features/" title="https://developers.arcgis.com/python/guide/appending-features/"&gt;Append Features | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to append the table using:&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;dataset_tbl.append(&lt;/SPAN&gt;&lt;SPAN class=""&gt;item_id&lt;/SPAN&gt;&lt;SPAN class="" style="color: #666666;"&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;new_csv_item_id&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;upload_format&lt;/SPAN&gt;&lt;SPAN class="" style="color: #666666;"&gt;='csv&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ba2121;"&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I get an error message "Unable to append data. Missing appendSourceInfo parameters.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I see that I should enter something here, but I'm not sure what.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE style="color: #404040; background-color: #fcfcfc; border: 1px solid #e1e4e5; margin-bottom: 24px;"&gt;&lt;TBODY&gt;&lt;TR class=""&gt;&lt;TD style="background-color: transparent; border-bottom: 1px solid #e1e4e5; border-left: 0px solid #e1e4e5; font-size: 14.4px; padding: 8px 16px;"&gt;&lt;P style="font-size: 16px;"&gt;source_info&lt;/P&gt;&lt;/TD&gt;&lt;TD style="background-color: transparent; border-bottom: 1px solid #e1e4e5; border-left: 1px solid #e1e4e5; font-size: 14.4px; padding: 8px 16px;"&gt;&lt;P style="font-size: 16px;"&gt;optional dictionary. This is only needed when appending data from excel or csv. The appendSourceInfo can be the publishing parameter returned from analyze the csv or excel file.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Note that this table has no geometry, it is a data table only. Also this table is joined, so it cannot be overwritten.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Mar 2020 14:14:04 GMT</pubDate>
    <dc:creator>Jean-SebastienLauzon</dc:creator>
    <dc:date>2020-03-30T14:14:04Z</dc:date>
    <item>
      <title>Append data from csv to hosted table using Python API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/append-data-from-csv-to-hosted-table-using-python/m-p/664978#M33161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to append data to a hosted Table from a csv file using the Python API.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This can be done in AGOL, by choosing Update Data -&amp;gt; Append data to layer, how would that be done in Python.&lt;/P&gt;&lt;P&gt;I've tried to follow this:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/python/guide/appending-features/" title="https://developers.arcgis.com/python/guide/appending-features/"&gt;Append Features | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to append the table using:&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;dataset_tbl.append(&lt;/SPAN&gt;&lt;SPAN class=""&gt;item_id&lt;/SPAN&gt;&lt;SPAN class="" style="color: #666666;"&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;new_csv_item_id&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;upload_format&lt;/SPAN&gt;&lt;SPAN class="" style="color: #666666;"&gt;='csv&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ba2121;"&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I get an error message "Unable to append data. Missing appendSourceInfo parameters.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I see that I should enter something here, but I'm not sure what.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE style="color: #404040; background-color: #fcfcfc; border: 1px solid #e1e4e5; margin-bottom: 24px;"&gt;&lt;TBODY&gt;&lt;TR class=""&gt;&lt;TD style="background-color: transparent; border-bottom: 1px solid #e1e4e5; border-left: 0px solid #e1e4e5; font-size: 14.4px; padding: 8px 16px;"&gt;&lt;P style="font-size: 16px;"&gt;source_info&lt;/P&gt;&lt;/TD&gt;&lt;TD style="background-color: transparent; border-bottom: 1px solid #e1e4e5; border-left: 1px solid #e1e4e5; font-size: 14.4px; padding: 8px 16px;"&gt;&lt;P style="font-size: 16px;"&gt;optional dictionary. This is only needed when appending data from excel or csv. The appendSourceInfo can be the publishing parameter returned from analyze the csv or excel file.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Note that this table has no geometry, it is a data table only. Also this table is joined, so it cannot be overwritten.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2020 14:14:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/append-data-from-csv-to-hosted-table-using-python/m-p/664978#M33161</guid>
      <dc:creator>Jean-SebastienLauzon</dc:creator>
      <dc:date>2020-03-30T14:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: Append data from csv to hosted table using Python API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/append-data-from-csv-to-hosted-table-using-python/m-p/664979#M33162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jean-Sebastien,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use ArcGIS Pro's &lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/append.htm"&gt;Append &lt;/A&gt;tool to do this.&amp;nbsp; If you initially run into issues with the CSV as the input table, you may want to try converting it to a geodatabase table, and then using this as the input for the Append.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2020 15:21:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/append-data-from-csv-to-hosted-table-using-python/m-p/664979#M33162</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2020-03-30T15:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Append data from csv to hosted table using Python API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/append-data-from-csv-to-hosted-table-using-python/m-p/664980#M33163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just got it to work&amp;nbsp;by feeding in the result of gis.content.analyze as the source_info argument&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;param1 = gis.content.analyze(item=csvUpdate_item.id)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dataset_tbl.append(item_id=csvUpdate_item.id,upload_format='csv',source_info=param1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2020 15:55:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/append-data-from-csv-to-hosted-table-using-python/m-p/664980#M33163</guid>
      <dc:creator>Jean-SebastienLauzon</dc:creator>
      <dc:date>2020-03-30T15:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Append data from csv to hosted table using Python API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/append-data-from-csv-to-hosted-table-using-python/m-p/664981#M33164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the content or correct form of the content of the variable&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;dataset_tbl.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;I tried the following three:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;oldcsv = gis.content.get(tbl)&amp;nbsp; where the tbl is the item id?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;response "item object has no attribute 'append'"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;oldcsvFLC = FeatureLayerCollection.fromitem(oldcsv)?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;response&amp;nbsp; 'FeatureLayerCollection' object has no attribute 'append'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;3.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;tbl = oldcsvFLC.tables&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;response "append() takes no keyword arguments"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;My source data is a csv file loaded into AGOL.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;My target table (oldcsv) is a hosted table on AGOL.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Sep 2020 17:18:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/append-data-from-csv-to-hosted-table-using-python/m-p/664981#M33164</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-09-05T17:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: Append data from csv to hosted table using Python API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/append-data-from-csv-to-hosted-table-using-python/m-p/664982#M33165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming you have a hosted table on AGOL that you want to update using a csv file already uploaded on AGOL. This is what I do. Replace {} by your file/id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;para1=gis.content.analyze(item='{your new csv ID}')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ExistingData= gis.content.get({ID of your hosted table on AGOL)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dataset_tbl = ExistingData.tables[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dataset_tbl.append(item_id = {&lt;SPAN&gt;your new csv ID&lt;/SPAN&gt;}, upload_format = 'csv', source_info = para1, upsert=False)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2020 11:25:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/append-data-from-csv-to-hosted-table-using-python/m-p/664982#M33165</guid>
      <dc:creator>Jean-SebastienLauzon</dc:creator>
      <dc:date>2020-09-08T11:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: Append data from csv to hosted table using Python API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/append-data-from-csv-to-hosted-table-using-python/m-p/664983#M33166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much.&amp;nbsp; It worked like a charm.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Sep 2020 21:10:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/append-data-from-csv-to-hosted-table-using-python/m-p/664983#M33166</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-09-10T21:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Append data from csv to hosted table using Python API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/append-data-from-csv-to-hosted-table-using-python/m-p/1514873#M60646</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/329477"&gt;@Jean-SebastienLauzon&lt;/a&gt;&amp;nbsp;I arrived here looking for this solution and it works like a charm...so 4 years later (as&amp;nbsp; it's still not in the ESRI documentation) your help is very much appreciated!&lt;BR /&gt;&lt;BR /&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10527"&gt;@JakeSkinner&lt;/a&gt;&amp;nbsp;I was also pointed towards using Pro's append tool by ESRI staff when I asked a similar question, but when you want to include it as part of a scheduled notebook in AGOL that isn't an option! And when an append command exists in the Python API it should be usable!&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 11:13:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/append-data-from-csv-to-hosted-table-using-python/m-p/1514873#M60646</guid>
      <dc:creator>RichardHowe</dc:creator>
      <dc:date>2024-08-05T11:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Append data from csv to hosted table using Python API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/append-data-from-csv-to-hosted-table-using-python/m-p/1514878#M60647</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/75013"&gt;@RichardHowe&lt;/a&gt;&amp;nbsp;just an FYI, the Advanced Runtime for AGOL Notebooks contains arcpy.&lt;/P&gt;&lt;P&gt;&lt;A href="https://doc.arcgis.com/en/arcgis-online/create-maps/specify-the-runtime-of-a-notebook.htm#:~:text=the%20Advanced%20runtime%20contains%20all%20of%20the%20same%20libraries%20as%20well%20as%20ArcPy%20and%20some%20related%20libraries" target="_blank"&gt;https://doc.arcgis.com/en/arcgis-online/create-maps/specify-the-runtime-of-a-notebook.htm#:~:text=the%20Advanced%20runtime%20contains%20all%20of%20the%20same%20libraries%20as%20well%20as%20ArcPy%20and%20some%20related%20libraries&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 11:39:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/append-data-from-csv-to-hosted-table-using-python/m-p/1514878#M60647</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2024-08-05T11:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Append data from csv to hosted table using Python API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/append-data-from-csv-to-hosted-table-using-python/m-p/1514899#M60649</link>
      <description>&lt;P&gt;Thanks Jake, noted...albeit at a cost &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 12:26:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/append-data-from-csv-to-hosted-table-using-python/m-p/1514899#M60649</guid>
      <dc:creator>RichardHowe</dc:creator>
      <dc:date>2024-08-05T12:26:10Z</dc:date>
    </item>
  </channel>
</rss>

