Overwrite a hosted file WITHOUT a feature service

795
2
Jump to solution
11-23-2020 01:50 PM
DavidDodds2
New Contributor II

I have a csv that is hosted on our portal.  The csv does NOT have an associated feature service of any kind.  Looking through the documentation, I see methods for overwriting the feature service (Overwriting feature layers | ArcGIS for Developers) but if the file doesn't have a feature layer, I can't seem to make it work.

Can anyone please direct me to the documentation or have a Python example of updating a hosted file only?

I guess I can create a feature layer as a last resort, but I don't have any other need for one.  I only want to update the CSV file so users can download the latest version of the file.  The purpose is to share the file, not a service.

I'm looking for the Python equivalent of using the Update button.

UpdateButton1.JPG

UpdateButton.JPG

Thanks!

0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

Hi David,

Have you tried using the arcgis.gis.Item.update method?

For example:

myItem=arcgis.gis.Item(itemid="abc123")

myItem.update(data=r"/path/to/my.csv")

Best,

Calvin

View solution in original post

2 Replies
by Anonymous User
Not applicable

Hi David,

Have you tried using the arcgis.gis.Item.update method?

For example:

myItem=arcgis.gis.Item(itemid="abc123")

myItem.update(data=r"/path/to/my.csv")

Best,

Calvin

DavidDodds2
New Contributor II

Thank you, Calvin!  That's exactly what I was looking for.

0 Kudos