I have been attempting to automate a process where I normally download CSVs from several different places, & manually overwrite the hosted tables in AGOL. I'd like to automate this all in a script that I can schedule to run on a nightly basis. (As background, the data feeds several metrics dashboards viewed by Admin.)
I have yet to get the hosted table to update in AGOL.
1. Download updated CSV & Upload to Pandas dataframe
2. remove null rows & format date columns.
3. Export dataframe to new CSV.
4. Update hosted table in AGOL with new CSV.
When I view the hosted table, there are two different updated dates showing. Picture attached.
The first shows the date I ran the script (today), but the second shows the date I manually overwrote / updated the table (yesterday).
I had been following https://community.esri.com/thread/183390-arcgis-online-service-overwrite-using-python-api
below is what I have been using to update.
palTable <SPAN class="operator token">=</SPAN> gis<SPAN class="punctuation token">.</SPAN>content<SPAN class="punctuation token">.</SPAN>get<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'28b7f819dce24647aebad88d04ff3815'</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="comment token">#This ets the hosted table in AGOL</SPAN>
palCSV <SPAN class="operator token">=</SPAN> gis<SPAN class="punctuation token">.</SPAN>content<SPAN class="punctuation token">.</SPAN>get<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'65f1e32cda224199b6ec10c4139c2f1a'</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="comment token">#This gets the CSV in AGOL</SPAN>
palCSV<SPAN class="punctuation token">.</SPAN>update<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN> data<SPAN class="operator token">=</SPAN>newCSV<SPAN class="punctuation token">)</SPAN> <SPAN class="comment token">#This updates the CSV on AGOL</SPAN>
palTable<SPAN class="punctuation token">.</SPAN>update<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN> data<SPAN class="operator token">=</SPAN>newCSV<SPAN class="punctuation token">)</SPAN> <SPAN class="comment token">#This updates the hosted table on AGOL</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>Update the CSV & re downloading the file shows that it correctly updated itself.
Viewing the data on the hosted table shows that it has not updated itself.
Is there a way to "refresh" the table or a better syntax?
Thanks!