<?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: How to update a hosted table in AGOL using Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/1407841#M70284</link>
    <description>&lt;P&gt;Hosted Table (no features).&amp;nbsp; Sorry...brain is not fully functioning due to relief.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Apr 2024 04:03:55 GMT</pubDate>
    <dc:creator>MichelleMcGill</dc:creator>
    <dc:date>2024-04-10T04:03:55Z</dc:date>
    <item>
      <title>How to update a hosted table in AGOL using Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/510275#M40100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been attempting to automate a process where I normally download CSVs from several different places, &amp;amp; manually overwrite the hosted tables in AGOL.&amp;nbsp; I'd like to automate this all in a script that I can schedule to run on a nightly basis.&amp;nbsp; (As background, the data feeds several metrics dashboards viewed by Admin.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have yet to get the hosted table to update in AGOL.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Download updated CSV &amp;amp; Upload to Pandas dataframe&lt;/P&gt;&lt;P&gt;2. remove null rows &amp;amp; format date columns.&lt;/P&gt;&lt;P&gt;3. Export dataframe to new CSV.&lt;/P&gt;&lt;P&gt;4. Update hosted table in AGOL with new CSV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I view the hosted table, there are two different updated dates showing.&amp;nbsp; Picture attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first shows the date I ran the script (today), but the second shows the date I manually overwrote / updated the table (yesterday).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had been following&amp;nbsp;&lt;A _jive_internal="true" href="https://community.esri.com/thread/183390-arcgis-online-service-overwrite-using-python-api" target="_blank"&gt;https://community.esri.com/thread/183390-arcgis-online-service-overwrite-using-python-api&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;below is what I have been using to update.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;palTable &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'28b7f819dce24647aebad88d04ff3815'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;#This ets the hosted table in AGOL&lt;/SPAN&gt;
palCSV &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'65f1e32cda224199b6ec10c4139c2f1a'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;    &lt;SPAN class="comment token"&gt;#This gets the CSV in AGOL&lt;/SPAN&gt;

palCSV&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;update&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; data&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;newCSV&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;#This updates the CSV on AGOL&lt;/SPAN&gt;
palTable&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;update&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; data&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;newCSV&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;#This updates the hosted table on AGOL‍‍‍‍‍&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update the CSV &amp;amp; re downloading the file shows that it correctly updated itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Viewing the data on the hosted table shows that it has not updated itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to "refresh" the table or a better syntax?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:21:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/510275#M40100</guid>
      <dc:creator>Kara_Shindle</dc:creator>
      <dc:date>2021-12-11T22:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a hosted table in AGOL using Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/510276#M40101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Figured it out after several frustrating weeks!&amp;nbsp; After a while, too much documentation is as bad as not enough...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Had to use the FeatureLayerCollection class from the arcgis Features module.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then used the manager helper object to overwrite my existing hosted table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# this allows me to access the manager helper object to overwrite my currently existing hosted table (commRecTable)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;features &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; FeatureLayerCollection
commRec_collection &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; FeatureLayerCollection&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;fromitem&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;commRecTable&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# This uses the manager helper object to overwrite my existing hosted table with the new CSV my script outputed (commRecCSV)&lt;/SPAN&gt;
commRec_collection&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;manager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;overwrite&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;commRecCSV&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:21:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/510276#M40101</guid>
      <dc:creator>Kara_Shindle</dc:creator>
      <dc:date>2021-12-11T22:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a hosted table in AGOL using Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/510277#M40102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kara,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying the same thing and I get a job failed error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've logged in to the organizational account in the script where I'm an administrator and here is the rest of the code&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=""&gt;&lt;CODE&gt;&lt;SPAN class=""&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class=""&gt;.&lt;/SPAN&gt;features &lt;SPAN class=""&gt;import&lt;/SPAN&gt; FeatureLayerCollection&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;oldcsv = gis.content.get('ecc751eadabe43c083360c07bb7cghbc')&lt;/P&gt;&lt;P&gt;oldcsvFLC = FeatureLayerCollection.fromitem(oldcsv)&lt;/P&gt;&lt;P&gt;oldcsvFLC.manager.overwrite(r'C:\path\out4.csv')&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the response below.&amp;nbsp; This test was done on 40 records but I eventually want to use a dataset with &amp;gt;100,000&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;Any trick you are using to get this to work.&amp;nbsp; &lt;/DIV&gt;&lt;DIV class=""&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;I'm trying to overwrite a hosted table too.&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;Thanks&lt;/DIV&gt;&lt;DIV class=""&gt;Brian&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;---------------------------------------------------------------------------&lt;/SPAN&gt;&lt;SPAN class=""&gt;Exception&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Traceback (most recent call last)&lt;SPAN class=""&gt;&amp;lt;ipython-input-51-7974c8cc0fe0&amp;gt;&lt;/SPAN&gt; in &lt;SPAN class=""&gt;&amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;----&amp;gt; 1&lt;/SPAN&gt;&lt;SPAN class=""&gt; oldcsvFLC&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;manager&lt;SPAN class=""&gt;.&lt;/SPAN&gt;overwrite&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;r'C:\path\out4.csv'&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone1\lib\site-packages\arcgis\features\managers.py&lt;/SPAN&gt; in &lt;SPAN class=""&gt;overwrite&lt;/SPAN&gt;&lt;SPAN class=""&gt;(self, data_file)&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; 1324&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class=""&gt;#region Perform overwriting&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; 1325&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class=""&gt;if&lt;/SPAN&gt; related_data_item&lt;SPAN class=""&gt;.&lt;/SPAN&gt;update&lt;SPAN class=""&gt;(&lt;/SPAN&gt;item_properties&lt;SPAN class=""&gt;=&lt;/SPAN&gt;params&lt;SPAN class=""&gt;,&lt;/SPAN&gt; data&lt;SPAN class=""&gt;=&lt;/SPAN&gt;data_file&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN class=""&gt;-&amp;gt; 1326&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;published_item &lt;SPAN class=""&gt;=&lt;/SPAN&gt; related_data_item&lt;SPAN class=""&gt;.&lt;/SPAN&gt;publish&lt;SPAN class=""&gt;(&lt;/SPAN&gt;publish_parameters&lt;SPAN class=""&gt;,&lt;/SPAN&gt; overwrite&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;True&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; 1327&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class=""&gt;if&lt;/SPAN&gt; published_item &lt;SPAN class=""&gt;is&lt;/SPAN&gt; &lt;SPAN class=""&gt;not&lt;/SPAN&gt; &lt;SPAN class=""&gt;None&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; 1328&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class=""&gt;return&lt;/SPAN&gt; &lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;'success'&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;True&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN class=""&gt;~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone1\lib\site-packages\arcgis\gis\__init__.py&lt;/SPAN&gt; in &lt;SPAN class=""&gt;publish&lt;/SPAN&gt;&lt;SPAN class=""&gt;(self, publish_parameters, address_fields, output_type, overwrite, file_type, build_initial_cache)&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; 9030&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class=""&gt;return&lt;/SPAN&gt; Item&lt;SPAN class=""&gt;(&lt;/SPAN&gt;self&lt;SPAN class=""&gt;.&lt;/SPAN&gt;_gis&lt;SPAN class=""&gt;,&lt;/SPAN&gt; ret&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;0&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;'serviceItemId'&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; 9031&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class=""&gt;else&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN class=""&gt;-&amp;gt; 9032&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;serviceitem_id &lt;SPAN class=""&gt;=&lt;/SPAN&gt; self&lt;SPAN class=""&gt;.&lt;/SPAN&gt;_check_publish_status&lt;SPAN class=""&gt;(&lt;/SPAN&gt;ret&lt;SPAN class=""&gt;,&lt;/SPAN&gt; folder&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; 9033&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class=""&gt;return&lt;/SPAN&gt; Item&lt;SPAN class=""&gt;(&lt;/SPAN&gt;self&lt;SPAN class=""&gt;.&lt;/SPAN&gt;_gis&lt;SPAN class=""&gt;,&lt;/SPAN&gt; serviceitem_id&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; 9034&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class=""&gt;~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone1\lib\site-packages\arcgis\gis\__init__.py&lt;/SPAN&gt; in &lt;SPAN class=""&gt;_check_publish_status&lt;/SPAN&gt;&lt;SPAN class=""&gt;(self, ret, folder)&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; 9257&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class=""&gt;#print(str(job_response))&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; 9258&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class=""&gt;if&lt;/SPAN&gt; job_response&lt;SPAN class=""&gt;.&lt;/SPAN&gt;get&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;"status"&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt; &lt;SPAN class=""&gt;in&lt;/SPAN&gt; &lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;"esriJobFailed"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;"failed"&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN class=""&gt;-&amp;gt; 9259&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;raise&lt;/SPAN&gt; Exception&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;"Job failed."&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; 9260&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class=""&gt;elif&lt;/SPAN&gt; job_response&lt;SPAN class=""&gt;.&lt;/SPAN&gt;get&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;"status"&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt; &lt;SPAN class=""&gt;==&lt;/SPAN&gt; &lt;SPAN class=""&gt;"esriJobCancelled"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; 9261&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class=""&gt;raise&lt;/SPAN&gt; Exception&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;"Job cancelled."&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;Exception&lt;/SPAN&gt;: Job failed. &lt;/PRE&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2020 19:57:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/510277#M40102</guid>
      <dc:creator>BrianKaplan</dc:creator>
      <dc:date>2020-04-01T19:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a hosted table in AGOL using Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/510278#M40103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found a solution.&amp;nbsp; If you add the csv file to AGOL without publishing it then publish it (in my case as a table without geocoding), the overwrite method works (oldcsvFLC.manager.overwrite(r'C:\path\out4.csv').&amp;nbsp;&amp;nbsp;&amp;nbsp; It is when I publish the table from ArcGIS Pro (presumably ArcMap too) that the overwrite method doesn't work.&amp;nbsp; I suspect it has something to do with a service definition file which I do not see if I publish from within AGOL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2020 14:10:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/510278#M40103</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-04-02T14:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a hosted table in AGOL using Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/510279#M40104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using ArcGIS for&amp;nbsp;Python API&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Get a feature service out of your hosted feature service item&lt;BR /&gt;fs = AGOLConnection.content.get('your feature service item id')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Get the table you are interested in. Assuming first one&lt;BR /&gt;myTable = fs.ltabless[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#declare empty array to hold edits&lt;/P&gt;&lt;P&gt;fEdits = []&lt;/P&gt;&lt;P&gt;#Now iterate from source data/rows and fill an array with edits&lt;/P&gt;&lt;P&gt;for index, row in mySourceFeatureSet.iterrows():&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;BR /&gt; &lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;fEdit = {&lt;BR /&gt; "attributes": {&lt;BR /&gt; "ObjectID": row.ObjectId,&lt;BR /&gt; "myField1": row.Field1,&lt;BR /&gt;&lt;SPAN&gt;"my&lt;/SPAN&gt;&lt;SPAN&gt;Field2&lt;/SPAN&gt;&lt;SPAN&gt;": row.&lt;/SPAN&gt;&lt;SPAN&gt;Field2&lt;/SPAN&gt;&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;fEdits.append(fEdit)&lt;/P&gt;&lt;P&gt;#now apply adds. If you want Edits then use (updates=fEdits)&lt;BR /&gt; ret = myFeatureSet.edit_features(adds=fEdits)&lt;/P&gt;&lt;P&gt;#ideally you should inspect the 'ret' object because it will tell you if success / failure&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2020 14:55:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/510279#M40104</guid>
      <dc:creator>GeofyAdmin</dc:creator>
      <dc:date>2020-04-02T14:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a hosted table in AGOL using Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/510280#M40105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much.&amp;nbsp; This is very helpful.&amp;nbsp; I'll give it a try.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2020 17:53:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/510280#M40105</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-04-03T17:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a hosted table in AGOL using Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/510281#M40106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In AGOL on the table's Overview page, if you click to Update the table, does it only give you the option to Append? If so, the script will fail on overwrite, IME. My solution was to set a field in the hosted table as Unique. This adds the Overwrite option in AGOL, and allows the overwrite function to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I'm running into now is that as soon as I use the table in a hosted join layer, the unique option&amp;nbsp;switches back to No and I get an error saying there are duplicates (there aren't) when I try to switch it back.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2020 17:17:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/510281#M40106</guid>
      <dc:creator>dmacq</dc:creator>
      <dc:date>2020-04-17T17:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a hosted table in AGOL using Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/510282#M40107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This worked for my issue. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2020 20:45:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/510282#M40107</guid>
      <dc:creator>dmacq</dc:creator>
      <dc:date>2020-04-17T20:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a hosted table in AGOL using Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/510283#M40108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;my apologies for not seeing your questions and responding, I just got back from maternity leave.&amp;nbsp; Glad you got it resolved!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2020 17:16:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/510283#M40108</guid>
      <dc:creator>Kara_Shindle</dc:creator>
      <dc:date>2020-05-12T17:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a hosted table in AGOL using Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/1407840#M70283</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/228958"&gt;@Kara_Shindle&lt;/a&gt;&amp;nbsp;!!! You are my hero!&amp;nbsp; I, too, have struggled for several weeks to "update" a hosted feature table (no geographic data) to no avail but THIS solved my problem.&amp;nbsp; Somehow we must get this thread elevated as this resolved my issue on the first try.&amp;nbsp; Again THANK YOU!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 04:01:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/1407840#M70283</guid>
      <dc:creator>MichelleMcGill</dc:creator>
      <dc:date>2024-04-10T04:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a hosted table in AGOL using Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/1407841#M70284</link>
      <description>&lt;P&gt;Hosted Table (no features).&amp;nbsp; Sorry...brain is not fully functioning due to relief.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 04:03:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-update-a-hosted-table-in-agol-using-python/m-p/1407841#M70284</guid>
      <dc:creator>MichelleMcGill</dc:creator>
      <dc:date>2024-04-10T04:03:55Z</dc:date>
    </item>
  </channel>
</rss>

