I have a notebook that creates views from hosted feature layers. The money line is here:
new_view = flc.manager.create_view(new_view_name)
It is pretty rudimentary - It creates a view with all the layers.
It works fine unless users have selected the option to assign unique ids (in ArcPro). When users have assigned this option, the notebook creates a SERIOUSLY messed up view (mixed up geometry - line layers are points, point layers polygons...). Unfortunately, it sometimes is not caught until later. We make views with empty layers and you don't see the problem until you try to add data and things don't work.
This BUG appears to explain the problem, but it's status is 'As-Designed' Is there a way around this? This is a fairly open question, I realize, but I'm hoping to get started finding an answer. I'm somewhat new and this wrinkle is a little over my head. Any help would much appreciated. Thank you!
https://support.esri.com/en-us/bug/creating-a-hosted-feature-layer-view-using-arcgis-api-f-bug-00015...