Select to view content in your preferred language

Portal - Publish CSV as Table (not FeatureLayer)

797
1
04-16-2020 01:55 PM
GregHorne
Regular Contributor

upload_file = "c:\data.csv"

file_properties = {'title': friendly_name,
   'tags': 'public, data, animal, welfare',
   'type': 'CSV'
}

item = gis.content.add(file_properties, upload_file)
misc = item.publish()

===

I want to publish it as a Table but item.publish() results in a FeatureLayer being published.

When I do this interactively through portal, there is an option Locate Features By: coordinates or none.

I am not finding where I can in Python set this to none.

Suggestions?

0 Kudos
1 Reply
BenTurrell
Frequent Contributor

Hey Greg Horne‌,

If you look here you can see documentation on adding a csv and then publishing it as a feature layer:

Publishing SDs, Shapefiles and CSVs | ArcGIS for Developers 

If you use just this part it should just add to the portal and not publish a feature layer:

upload_file = "c:\data.csv"   file_properties = {'title': friendly_name,    'tags': 'public, data, animal, welfare',    'type': 'CSV' }   item = gis.content.add(file_properties, upload_file)

This line here is the part that is publishing the csv as a feature layer.

misc = item.publish()

Thanks,

Ben


If this answer was helpful please mark it as helpful. If this answer solved your question please mark it as the answer to help others who have the same question.