Ihave upload into a Microsoft Excel on portal,I want to publish it to a hosted Table.
If I use Item.publish() it will be ValueError,what should I do?
csv_file = 'D:/Test.csv'
csv_properties={'type':'Microsoft Excel','title':'Test','tags':['Test','Excel']}
csv_item = gis.content.add(csv_properties, None, None, None, None,'Test_Folder')
Hello Chai-Yuan Liu,
If you want to publish a csv to portal you can do the following....
import arcgis
import json
from arcgis.gis import GIS
gis = GIS(None,'username', 'password', verify_cert=False)
try:
# Path to the CSV file
pathToFile = r'path to file'
# Add the CSV file to portal.
item = gis.content.add({'title': 'testcsv'}, pathToFile)
# If you want the table as a hosted feature layer then publish the item
item.publish()
except Exception as e:
print(e)
How could I publish the table as a hosted table instead of a hosted feature layer?