I am trying to use JSONToFeatures to add features from a JSON file to an existing empty feature class using arcpy and I get the following error:
ERROR 000206: Cannot create FeatureClass '<featureClass'. The workspace is not connected.
out_path = r"C:\\TMP"
gdb_name = "test.gdb"
gdb_full_path = os.path.join(out_path,gdb_name)
arcpy.env.workspace = gdb_full_path
try:
jsonFile = os.path.join(out_path,'Account.json')
featureClass = os.path.join(gdb_full_path,'Account')
arcpy.JSONToFeatures_conversion(jsonFile, featureClass)
except RuntimeError as err:
print(err)If I delete the target Account feature class then run this code, it works and Account is written to a new feature class.
Unfortunately, I am having to add these features to an existing feature class as certain input string fields are longer than the ArcGIS default 1024 chars and so I need to have these field widths pre-configured to avoid other errors.
Python 2.7
ArcDesktop 10.8