According to the documentation: https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#viewmanager, to create a hosted feature layer view in code with the overwrite option:
create(name, spatial_reference=None, extent=None, allow_schema_changes=True, updateable=True, capabilities='Query', view_layers=None, view_tables=None, *, description=None, tags=None, snippet=None, overwrite=None, set_item_id=None, preserve_layer_ids=False, visible_fields=None, query=None)¶
overwrite Optional Boolean. If true, the view is overwritten, False is the default.
In my code:
the_view = the_item.view_manager.create(name=the_view_name, view_layers=the_layers, overwrite=True)
Throws an error:
local variable 'logging' referenced before assignment
and does not complete.
The same issue is exposed with creating the view using this method:
flc = FeatureLayerCollection.fromitem(the_item)
the_view = flc.manager.create_view(name=the_view_name, view_layers=the_layers, overwrite=True)
Can someone lend me a hand?
TIA