Overwrite a hosted file WITHOUT a feature service

162
2
Jump to solution
11-23-2020 01:50 PM
New Contributor

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!

Reply
0 Kudos
1 Solution

Accepted Solutions
Esri Contributor

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
Esri Contributor

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

New Contributor

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

Reply
0 Kudos