I'm new to the esri community and would like to know if there is a way to overwrite the data in a hosted feature layer while retaining the layer definition. The issue I am running into is after I execute the python script to overwrite the existing layer, all of custom layer definitions, such as "drawingInfo", "maxRecordCount", and "typeIdFieldID", are set back to the default.
As a workaround, I attempted to retrieve the layer definition by retrieving the 'properties' of the feature layer and then using 'manager.update_definition' to re-establish the custom definition but when I do that I get 'TypeError: Object of type PropertyMap is not JSON serializable'
Any help would be appreciated.
Thank you