Hi,
I am trying to create some hosted feature layer views that include the tables as well and I can't seem to find a way to do it. Using the Python API, I am able to either 1) Create a new empty service (as_view), or 2) Create a view from the FeatureCollection, but this leaves away the tables.
This code creates a view with only the feature layers, not the tables:
service = gis.content.get('my_id')
flc= FeatureLayerCollection.fromitem(service)
theVw = flc.manager.create_view("newly_created_view)
This code creates a new service, but it is empty:
gis.content.create_service(name="myTableView",is_view=True)
When I look at what's happening in ArcGIS Online, when I create a view, I see a combination of 3 REST Calls: 1) Create Service, 2) addToDefinition and 3) update. I am trying to replicate this in Python using the add_to_definition fuction, but it does not work, since I would need to run it on a particular layer or table (.e.g. theVw.tables[0].manager.add_to_definition), but if I don't have them in the view, I cannot do anything.
Thanks! Any help is appreciated!