I have an automated process (using arcpy of course) that will create a service draft and publish a feature class from a gdb successfully. Once the service is up, I can edit existing features and play around with related records in ArcGIS Online and Field Maps. However, when I try to add new features I am unable to because of a default value conflicting with an existing value in the feature class, even though I tried to save with a different value.
I understand that this can be remedied in the feature class' feature template in Desktop as well as Map Viewer Classic, but I am having a couple of issues I was wondering if I could get some help with:
1) According to this link:
https://doc.arcgis.com/en/arcgis-online/manage-data/manage-feature-templates.htm
I should be able to manage feature templates in Map Viewer. But when I try to load a feature service into a map and click on "Edit", the "Manage" button does not appear. I understand that I can only see this button if I am the owner or admin, but I am not clear on what that means. Is the owner the person that published the service or the one that adds it to the map? When I try to set the sharing properties to the admin only and have to log in to view the layer in map viewer, I am still not able to see the "Manage" button. Additionally, adding it to a map in ArcGIS Online Content under a different account does not allow me to see the "Manage" button either.
2) Is there a way to add an empty feature template programatically using arcpy or editing the service somehow?
EDIT: I should also mention that the layer is on one of our ArcGIS Servers and I am adding the layer to the map by using the feature service link. I am also not able to add the feature service to my ArcGIS Online content due to a generic error when trying to add it.
Additionally this service was published on a 10.6.1 server
Solved! Go to Solution.
You can only change templates and types in Map Viewer Classic and Field Maps if the layer is a hosted feature layer. Since your layer is not a hosted feature layer (it's hosted by a separate ArcGIS Server) you cannot change them.
You need to modify the templates in ArcMap or Pro and then re-publish (overwrite) your feature service.
For hosted feature layers, you can script this or make modifications directly at the REST endpoint via updateDefinition. This is not possible for non-hosted feature layers. I'm not sure if you can automate this with arcpy prior to publishing.
You can only change templates and types in Map Viewer Classic and Field Maps if the layer is a hosted feature layer. Since your layer is not a hosted feature layer (it's hosted by a separate ArcGIS Server) you cannot change them.
You need to modify the templates in ArcMap or Pro and then re-publish (overwrite) your feature service.
For hosted feature layers, you can script this or make modifications directly at the REST endpoint via updateDefinition. This is not possible for non-hosted feature layers. I'm not sure if you can automate this with arcpy prior to publishing.
Thanks for the response Aaron. Based on your reply I would think that there is no way to change the service definition to get this working on a non-hosted layer after it has been published?
EDIT: OOPS just saw your mention about not being able to do it on non-hosted layers. Thanks!