Hello everyone,
I want to create hosted feature view layers on arcgis enterprise with REST API, httpcaller in FME. Although a new hosted view item is successfully created, the resulting view layer always remains empty (no layers inside it), and all attempts to attach the source layer fail.
Below is a clear explanation of what i am doing, what works, and where the process fails.
1. Environment
- ArcGIS Enterprise 11.5
- Hosted feature layer (source)
- Attempting to create hosted feature layer views programmatically
- The account performing the request is now:
- Owner of the hosted feature layer
- Administrator
2. What works
I successfully create a hosted feature layer view item using:
content/users/<owner>/createService
with parameters including:
isView=true
sourceItemId=<item_id_of_hosted_feature_layer>
The REST response confirms:
"success": true,
"isView": true
A new view item appears in the Enterprise Content page.
However:
The created view contains zero layers, every time.
Even though the source hosted feature layer contains a valid layer (layer 0 or 1 depending on configuration), the new view remains empty.
3. What fails
I have attempted the two documented approaches to populate the view:
A. /server/rest/admin/services/.../addToDefinition
This always returns:
{"error":{"code":500,"message":"Database error has occurred."}}
or:
"Field 'layerDefinitions' cannot be updated."
Maybe this endpoint may not be valid for Portal-managed hosted view layers, even though it is technically part of the ArcGIS Server Admin API.
B. /portal/sharing/rest/content/users/<owner>/items/<view_itemid>/addToDefinition
Following Esri documentation for item-level schema updates, we used a body such as:
addToDefinition={
"layerDefinitions": [
{
"id": 0,
"sourceLayerId": 1,
"sourceItemId": "<source_item_id>"
}
]
}&f=json
or alternative formats documented in the API.
Every version returns success for the item update, but the view layer remains empty.
Viewing the service JSON confirms "layers": [].
Does anyone have an idea what the problem might be and how to fix it?

