Select to view content in your preferred language

Feature layer added to Feature Service does not show in AGOL

5406
17
Jump to solution
06-15-2022 01:53 PM
MarkC1
by
Frequent Contributor

I've added a new feature layer to an existing feature service via the REST API (Add to Definition). The new feature layer gets added successfully and it is listed in the layers when viewing the service via the service URL. However, the layer does not appear in AGOL and I cannot access it. 

I've tested it with several existing feature services in my agol, by adding the exact same layer definition to multiple feature services. Some of for some of them it works perfectly but for others I get the above behaviour.  I have even tried to duplicate one of the existing layers in the feature services where I see this issue with no success.

Has anyone experienced this or can provide any help? I am guessing that there is something different about the layers it does not work on.

Edit: It seems to affect feature services originally published from Arcgis Pro

Example:

Point Layer 2 added via to existing layer via REST API. Visible at feature service URL but not showing up in AGOL

MarkC1_1-1655326316396.png

MarkC1_2-1655326365138.png

0 Kudos
2 Solutions

Accepted Solutions
MarkC1
by
Frequent Contributor

Ok, so I suspect this is related to feature services published from Arcgis Pro. If you view such the JSON for such a layer in AGOL assistant there is a "Data" page which specifies the layers. This does not seem to get updated when a new layer is added via the REST api. 

When you compare a feature service created directly in AGOL versus one published from Pro this data page is not present, only the feature service description. 

So, I edited the JSON on the data page in AGOL Assistant and just left an empty set of curly brackets and suddenly the layers I added via the REST api were visible in AGOL. This doesn't seem to have affect my existing data and the service seems to still work fine.

Feature service created via AGOL: Just one "Description Page"

MarkC1_1-1655329252620.png

Feature service created in Pro: Description page and Data page detail the layer

MarkC1_2-1655329343196.png

 

Edit made to the Data page:

 

MarkC1_0-1655329213908.png

 

View solution in original post

MarkC1
by
Frequent Contributor

To determine the database_username part of the table name just look at the json for any layer in your AGOL.This is the same for every layer/fs in your AGOL and doesn't change. Although I don't think it matters if you use the wrong one.

Below is JSON what will work and the steps involved. As a quick test, create a test feature service and see if you can add it.

You said above that you were able to successfully add a layer? Where/when is the 400 exception error occuring? It sounds like you are actually having trouble adding the layer in the first place. If so, it's probably poor json. The easiest thing to do is to copy the json from an existing feature layer and edit it.

An easy way is to first create the layer you want to add to your existing feature service as a new, seperate feature service. Define the fields etc. in Arcgis Pro or in AGOL, then just copy the json that AGOL creates for you.

So for example, here is a simple point layer I created in AGOL. Create you own layer with the fields etc. that you need.

MarkC1_0-1658654376395.png

View the feature service in and switch to Admin mode (link in top right):

MarkC1_1-1658654487662.png

Open the layer you want to "copy" to your existing feature service and view and copy the raw json:

MarkC1_2-1658654689238.png

MarkC1_3-1658654722580.png

Edit the json:

1. Add  { "layers" : [ to the beginning

2. Add corresponding closing brackets to the end ]}

3. Change the "Name" (Row 19)

3. Optional: Change the Layer ID (Row 15) to whatever number you want. If you leave it at 0 AGOL will just assign a layer id to it that doesnt' conflict with any other layers in the feature service

{  "layers" : [

{

  "adminLayerInfo" : {

    "tableName" : "db_72280.user_72280.Test_Point_Layer_TESTING", 

    "geometryField" : {"name" : "Shape"}, 

    "xssTrustedFields" : ""

  }, 

  "id" : 0, 

  "enableUseOfScaleOutReplicasWhenEditable" : true, 

  "name" : "Testing", 

  "type" : "Feature Layer", 

  "serviceItemId" : "e662b9687e584b07916701428c21c0dc", 

  "displayField" : "", 

  "description" : "", 

  "copyrightText" : "", 

  "defaultVisibility" : true, 

  "editingInfo" : {

    "lastEditDate" : 1658654341208

  }, 

  "relationships" : [], 

  "isDataVersioned" : false, 

  "hasContingentValuesDefinition" : false, 

  "supportsAppend" : true, 

  "supportsCalculate" : true, 

  "supportsASyncCalculate" : true, 

  "supportsTruncate" : true, 

  "supportsAttachmentsByUploadId" : true, 

  "supportsAttachmentsResizing" : true, 

  "supportsRollbackOnFailureParameter" : true, 

  "supportsStatistics" : true, 

  "supportsExceedsLimitStatistics" : true, 

  "supportsAdvancedQueries" : true, 

  "supportsValidateSql" : true, 

  "supportsCoordinatesQuantization" : true, 

  "supportsLayerOverrides" : true, 

  "supportsTilesAndBasicQueriesMode" : true, 

  "supportsFieldDescriptionProperty" : true, 

  "supportsQuantizationEditMode" : true, 

  "supportsApplyEditsWithGlobalIds" : false, 

  "supportsReturningQueryGeometry" : true, 

  "advancedQueryCapabilities" : {

    "supportsPagination" : true, 

    "supportsQueryAttachmentsCountOnly" : true, 

    "supportsPaginationOnAggregatedQueries" : true, 

    "supportsQueryRelatedPagination" : true, 

    "supportsQueryWithDistance" : true, 

    "supportsReturningQueryExtent" : true, 

    "supportsStatistics" : true, 

    "supportsOrderBy" : true, 

    "supportsDistinct" : true, 

    "supportsQueryWithResultType" : true, 

    "supportsSqlExpression" : true, 

    "supportsAdvancedQueryRelated" : true, 

    "supportsCountDistinct" : true, 

    "supportsPercentileStatistics" : true, 

    "supportsSpatialAggregationStatistics" : true, 

    "supportedSpatialAggregationStatistics" : [

      "EnvelopeAggregate", 

      "CentroidAggregate", 

      "ConvexHullAggregate"

    ], 

    "supportsQueryAttachments" : true, 

    "supportsLod" : true, 

    "supportsQueryWithLodSR" : false, 

    "supportedLodTypes" : [

      "geohash"

    ], 

    "supportsReturningGeometryCentroid" : false, 

    "supportsQueryWithDatumTransformation" : true, 

    "supportsHavingClause" : true, 

    "supportsOutFieldSQLExpression" : true, 

    "supportsMaxRecordCountFactor" : true, 

    "supportsTopFeaturesQuery" : true, 

    "supportsDisjointSpatialRel" : true, 

    "supportsQueryWithCacheHint" : true, 

    "supportedOperationsWithCacheHint" : [

      "query", 

      "queryTopFilter", 

      "queryAnalytics", 

      "queryAttachments", 

      "queryRelated"

    ], 

    "supportsQueryAttachmentsWithReturnUrl" : true, 

    "supportsQueryAnalytic" : true, 

    "supportsDefaultSR" : true, 

    "supportsFullTextSearch" : true

  }, 

  "advancedQueryAnalyticCapabilities" : {

    "supportsLinearRegression" : true, 

    "supportsAsync" : true, 

    "supportsPercentileAnalytic" : true

  }, 

  "advancedEditingCapabilities" : {

    "supportedSqlFormatsInCalculate" : [

      "standard"

    ], 

    "supportsAsyncApplyEdits" : true, 

    "supportsReturnEditResults" : true

  }, 

  "infoInEstimates" : [

    "extent", 

    "count"

  ], 

  "useStandardizedQueries" : true, 

  "geometryType" : "esriGeometryPoint", 

  "minScale" : 0, 

  "maxScale" : 0, 

  "extent" : {

    "xmin" : -17811118.526923772, 

    "ymin" : -15538711.096309224, 

    "xmax" : 17811118.526923772, 

    "ymax" : 15538711.096309224, 

    "spatialReference" : {

      "wkid" : 102100, 

      "latestWkid" : 3857

    }

  }, 

  "drawingInfo":{"renderer":{"type":"simple","symbol":{"type":"esriPMS","url":"RedSphere.png","imageData":"iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQBQYWludC5ORVQgdjMuNS4xTuc4+QAAB3VJREFUeF7tmPlTlEcexnve94U5mANQbgQSbgiHXHINlxpRIBpRI6wHorLERUmIisKCQWM8cqigESVQS1Kx1piNi4mW2YpbcZONrilE140RCTcy3DDAcL/zbJP8CYPDL+9Ufau7uqb7eZ7P+/a8PS8hwkcgIBAQCAgEBAICAYGAQEAgIBAQCAgEBAICAYGAQEAgIBAQCDx/AoowKXFMUhD3lQrioZaQRVRS+fxl51eBTZUTdZ41U1Rox13/0JF9csGJ05Qv4jSz/YPWohtvLmSKN5iTGGqTm1+rc6weICOBRbZs1UVnrv87T1PUeovxyNsUP9P6n5cpHtCxu24cbrmwKLdj+osWiqrVKhI0xzbmZ7m1SpJ+1pFpvE2DPvGTomOxAoNLLKGLscZYvB10cbYYjrJCb7A5mrxleOBqim+cWJRakZY0JfnD/LieI9V1MrKtwokbrAtU4Vm0A3TJnphJD4B+RxD0u0LA7w7FTE4oprOCMbklEGNrfdGf4IqnQTb4wc0MFTYibZqM7JgjO8ZdJkpMln/sKu16pHZGb7IfptIWg389DPp9kcChWODoMuDdBOhL1JgpisbUvghM7AqFbtNiaFP80RLnhbuBdqi0N+1dbUpWGde9gWpuhFi95yL7sS7BA93JAb+Fn8mh4QujgPeTgb9kAZf3Apd2A+fXQ38yHjOHozB1IAJjOSEY2RSIwVUv4d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Pee/8xIGjvlj8IQ/hk4G0JbWcX8MHPVDX4kveoq8ocn3xLM33NCZRcPHOGJYZIKfpQyq7JjHS6yJjcHujLHADgkpuC7h8F8zEVqXSNC2awE69lqhs8AamkO26HrbDt2H7dBVQov2NcW26CiwQtu+BWjdY4n2nZboTbfCmKcCnRyDO/YmyLPnDlHvjDH8G6zhS9/wlEnYR7X00fWrFYuWdVI0ZpuhcbcczW/R2qdAcz6t/bRov4mONeaaoYl+p22rHF0bVNAmKtBvweIXGxNcfFH8eNlC4m6wMWMusEnKpn5hyo48pj9gLe4SNG9QoGGLAk8z5XiaJUd99u8122/IpBA2K9BGg2vWWKAvRYVeLzEa7E1R422m2+MsSTem97nSYnfKyN6/mzATv7AUgqcMrUnmaFlLX3ysM0fj+t/b5lQLtK22QEfyAmiSLKFZpUJ7kBRPXKW4HqCYynWVHKSG2LkyZex1uO1mZM9lKem9Tx9jjY5iNEYo0bKMhn7ZAu0r6H5PpLXCAq0rKJClSjSGynE/QIkrQYqBPe6S2X+AJsY2Ped6iWZk6RlL0c2r5szofRsO9R5S1IfQLRCpQL1aifoYFerpsbkuTImaUJXuXIDiH6/Ys8vm3Mg8L2i20YqsO7fItKLcSXyn0kXccclVqv3MS6at9JU/Ox+ouns+SF6Z4cSupz7l8+z1ucs7LF1AQjOdxfGZzmx8Iu1TRcfnrioICAQEAgIBgYBAQCAgEBAICAQEAgIBgYBAQCAgEBAICAQEAv8H44b/6ZiGvGAAAAAASUVORK5CYII=","contentType":"image/png","width":15,"height":15}}}, 

  "allowGeometryUpdates" : true, 

  "hasAttachments" : true, 

  

  "attachmentProperties" : [

    {

      "name" : "id", 

      "fieldName" : "ATTACHMENTID", 

      "isEnabled" : true

    }, 

    {

      "name" : "globalId", 

      "fieldName" : "AttachmentGlobalID", 

      "isEnabled" : true

    }, 

    {

      "name" : "name", 

      "fieldName" : "ATT_NAME", 

      "isEnabled" : true

    }, 

    {

      "name" : "size", 

      "fieldName" : "DATA_SIZE", 

      "isEnabled" : true

    }, 

    {

      "name" : "contentType", 

      "fieldName" : "CONTENT_TYPE", 

      "isEnabled" : true

    }, 

    {

      "name" : "keywords", 

      "fieldName" : "Keywords", 

      "isEnabled" : true

    }, 

    {

      "name" : "exifInfo", 

      "fieldName" : "ExifInfo", 

      "isEnabled" : true

    }

  ], 

  "htmlPopupType" : "esriServerHTMLPopupTypeNone", 

  "hasM" : true, 

  "allowUpdateWithoutMValues" : true, 

  "hasZ" : false, 

  "objectIdField" : "OBJECTID", 

  "uniqueIdField" : 

  {

    "name" : "OBJECTID", 

    "isSystemMaintained" : true

  }, 

  "globalIdField" : "", 

  "typeIdField" : "", 

  "fields" : [

    {

      "name" : "OBJECTID", 

      "type" : "esriFieldTypeOID", 

      "alias" : "OBJECTID", 

      "sqlType" : "sqlTypeOther", 

      "nullable" : false, 

      "editable" : false, 

      "visible" : true, 

      "domain" : null, 

      "defaultValue" : null

    }, 

    {

      "name" : "Field1", 

      "type" : "esriFieldTypeString", 

      "alias" : "Field1", 

      "sqlType" : "sqlTypeOther", 

      "length" : 256, 

      "nullable" : true, 

      "editable" : true, 

      "visible" : true, 

      "domain" : null, 

      "defaultValue" : null

    }, 

    {

      "name" : "Field2", 

      "type" : "esriFieldTypeString", 

      "alias" : "Field2", 

      "sqlType" : "sqlTypeOther", 

      "length" : 256, 

      "nullable" : true, 

      "editable" : true, 

      "visible" : true, 

      "domain" : null, 

      "defaultValue" : null

    }

  ], 

  "indexes" : [

    {

      "name" : "Test_Point_Layer_TESTING_Shape_sidx", 

      "fields" : "Shape", 

      "isAscending" : false, 

      "isUnique" : false, 

      "description" : "Shape Index"

    }, 

    {

      "name" : "PK__Test_Poi__F4B70D85571405E5", 

      "fields" : "OBJECTID", 

      "isAscending" : true, 

      "isUnique" : true, 

      "description" : "clustered, unique, primary key"

    }

  ], 

  "dateFieldsTimeReference" : {

    "timeZone" : "UTC", 

    "respectsDaylightSaving" : false

  }, 

  "preferredTimeReference" : null, 

  "types" : [], 

  "templates" : [

    {

      "name" : "New Feature", 

      "description" : "", 

      "drawingTool" : "esriFeatureEditToolPoint", 

      "prototype" : {

        "attributes" : {

          "Field1" : null, 

          "Field2" : null

        }

      }

    }

  ], 

  "supportedQueryFormats" : "JSON, geoJSON, PBF", 

  "supportedAppendFormats" : "sqlite,geoPackage,shapefile,filegdb,featureCollection,geojson,csv,excel,imageCollection", 

  "supportedExportFormats" : "csv,shapefile,sqlite,geoPackage,filegdb,featureCollection,geojson,excel", 

  "supportedSpatialRelationships" : [

    "esriSpatialRelIntersects", 

    "esriSpatialRelContains", 

    "esriSpatialRelCrosses", 

    "esriSpatialRelEnvelopeIntersects", 

    "esriSpatialRelIndexIntersects", 

    "esriSpatialRelOverlaps", 

    "esriSpatialRelTouches", 

    "esriSpatialRelWithin", 

    "esriSpatialRelDisjoint", 

    "esriSpatialRelRelation"

  ], 

  "supportedContingentValuesFormats" : "JSON, PBF", 

  "supportedSyncDataOptions" : 4, 

  "hasStaticData" : false, 

  "maxRecordCount" : 2000, 

  "standardMaxRecordCount" : 32000, 

  "standardMaxRecordCountNoGeometry" : 32000, 

  "tileMaxRecordCount" : 8000, 

  "maxRecordCountFactor" : 1, 

  "capabilities" : "Create,Delete,Query,Update,Editing"

}
	]
	}

 

Add to your exsiting service layer. So here is a dummy one I set up:

Before

MarkC1_4-1658655427377.png

Add to Definition:

MarkC1_5-1658655464724.png

Remove the json already there and paste your edited json from above.

MarkC1_6-1658655557380.png

Paste in your edited json from above and you should see this response if successful:

MarkC1_7-1658655664607.png

 

 

 

 

 

 

 

View solution in original post

17 Replies
MarkC1
by
Frequent Contributor

Ok, so I suspect this is related to feature services published from Arcgis Pro. If you view such the JSON for such a layer in AGOL assistant there is a "Data" page which specifies the layers. This does not seem to get updated when a new layer is added via the REST api. 

When you compare a feature service created directly in AGOL versus one published from Pro this data page is not present, only the feature service description. 

So, I edited the JSON on the data page in AGOL Assistant and just left an empty set of curly brackets and suddenly the layers I added via the REST api were visible in AGOL. This doesn't seem to have affect my existing data and the service seems to still work fine.

Feature service created via AGOL: Just one "Description Page"

MarkC1_1-1655329252620.png

Feature service created in Pro: Description page and Data page detail the layer

MarkC1_2-1655329343196.png

 

Edit made to the Data page:

 

MarkC1_0-1655329213908.png

 

RyanTucker
Regular Contributor

I'm trying to do the same right now. I have been successful adding a layer to an  existing feature service using the rest API JSON example for Add To Definition.

However I'm having issues with my own JSON code. Would you be willing to share your JSON code? 

0 Kudos
MarkC1
by
Frequent Contributor

Hi @RyanTucker , sorry but I can't share the code. What's your issue? Was your feature service originally published from Arcgis Pro? If so, maybe you can try deleting the service definitio  that gets published with it? Did you try my fix above? 

0 Kudos
RyanTucker
Regular Contributor

@MarkC1  the data is loaded from a zipped file geodatabase. 

I'm thinking I'm having a syntax issue. When I submit my checked code (JSON lint)I'm getting a random 400 exception error. So I'm not even getting to the point of seeing a layer listed under the feature service. 

I'll try again. I guess one thing I don't understand from the Add to Definition example    is how do you determine the database_username part of the table name?

0 Kudos
MarkC1
by
Frequent Contributor

To determine the database_username part of the table name just look at the json for any layer in your AGOL.This is the same for every layer/fs in your AGOL and doesn't change. Although I don't think it matters if you use the wrong one.

Below is JSON what will work and the steps involved. As a quick test, create a test feature service and see if you can add it.

You said above that you were able to successfully add a layer? Where/when is the 400 exception error occuring? It sounds like you are actually having trouble adding the layer in the first place. If so, it's probably poor json. The easiest thing to do is to copy the json from an existing feature layer and edit it.

An easy way is to first create the layer you want to add to your existing feature service as a new, seperate feature service. Define the fields etc. in Arcgis Pro or in AGOL, then just copy the json that AGOL creates for you.

So for example, here is a simple point layer I created in AGOL. Create you own layer with the fields etc. that you need.

MarkC1_0-1658654376395.png

View the feature service in and switch to Admin mode (link in top right):

MarkC1_1-1658654487662.png

Open the layer you want to "copy" to your existing feature service and view and copy the raw json:

MarkC1_2-1658654689238.png

MarkC1_3-1658654722580.png

Edit the json:

1. Add  { "layers" : [ to the beginning

2. Add corresponding closing brackets to the end ]}

3. Change the "Name" (Row 19)

3. Optional: Change the Layer ID (Row 15) to whatever number you want. If you leave it at 0 AGOL will just assign a layer id to it that doesnt' conflict with any other layers in the feature service

{  "layers" : [

{

  "adminLayerInfo" : {

    "tableName" : "db_72280.user_72280.Test_Point_Layer_TESTING", 

    "geometryField" : {"name" : "Shape"}, 

    "xssTrustedFields" : ""

  }, 

  "id" : 0, 

  "enableUseOfScaleOutReplicasWhenEditable" : true, 

  "name" : "Testing", 

  "type" : "Feature Layer", 

  "serviceItemId" : "e662b9687e584b07916701428c21c0dc", 

  "displayField" : "", 

  "description" : "", 

  "copyrightText" : "", 

  "defaultVisibility" : true, 

  "editingInfo" : {

    "lastEditDate" : 1658654341208

  }, 

  "relationships" : [], 

  "isDataVersioned" : false, 

  "hasContingentValuesDefinition" : false, 

  "supportsAppend" : true, 

  "supportsCalculate" : true, 

  "supportsASyncCalculate" : true, 

  "supportsTruncate" : true, 

  "supportsAttachmentsByUploadId" : true, 

  "supportsAttachmentsResizing" : true, 

  "supportsRollbackOnFailureParameter" : true, 

  "supportsStatistics" : true, 

  "supportsExceedsLimitStatistics" : true, 

  "supportsAdvancedQueries" : true, 

  "supportsValidateSql" : true, 

  "supportsCoordinatesQuantization" : true, 

  "supportsLayerOverrides" : true, 

  "supportsTilesAndBasicQueriesMode" : true, 

  "supportsFieldDescriptionProperty" : true, 

  "supportsQuantizationEditMode" : true, 

  "supportsApplyEditsWithGlobalIds" : false, 

  "supportsReturningQueryGeometry" : true, 

  "advancedQueryCapabilities" : {

    "supportsPagination" : true, 

    "supportsQueryAttachmentsCountOnly" : true, 

    "supportsPaginationOnAggregatedQueries" : true, 

    "supportsQueryRelatedPagination" : true, 

    "supportsQueryWithDistance" : true, 

    "supportsReturningQueryExtent" : true, 

    "supportsStatistics" : true, 

    "supportsOrderBy" : true, 

    "supportsDistinct" : true, 

    "supportsQueryWithResultType" : true, 

    "supportsSqlExpression" : true, 

    "supportsAdvancedQueryRelated" : true, 

    "supportsCountDistinct" : true, 

    "supportsPercentileStatistics" : true, 

    "supportsSpatialAggregationStatistics" : true, 

    "supportedSpatialAggregationStatistics" : [

      "EnvelopeAggregate", 

      "CentroidAggregate", 

      "ConvexHullAggregate"

    ], 

    "supportsQueryAttachments" : true, 

    "supportsLod" : true, 

    "supportsQueryWithLodSR" : false, 

    "supportedLodTypes" : [

      "geohash"

    ], 

    "supportsReturningGeometryCentroid" : false, 

    "supportsQueryWithDatumTransformation" : true, 

    "supportsHavingClause" : true, 

    "supportsOutFieldSQLExpression" : true, 

    "supportsMaxRecordCountFactor" : true, 

    "supportsTopFeaturesQuery" : true, 

    "supportsDisjointSpatialRel" : true, 

    "supportsQueryWithCacheHint" : true, 

    "supportedOperationsWithCacheHint" : [

      "query", 

      "queryTopFilter", 

      "queryAnalytics", 

      "queryAttachments", 

      "queryRelated"

    ], 

    "supportsQueryAttachmentsWithReturnUrl" : true, 

    "supportsQueryAnalytic" : true, 

    "supportsDefaultSR" : true, 

    "supportsFullTextSearch" : true

  }, 

  "advancedQueryAnalyticCapabilities" : {

    "supportsLinearRegression" : true, 

    "supportsAsync" : true, 

    "supportsPercentileAnalytic" : true

  }, 

  "advancedEditingCapabilities" : {

    "supportedSqlFormatsInCalculate" : [

      "standard"

    ], 

    "supportsAsyncApplyEdits" : true, 

    "supportsReturnEditResults" : true

  }, 

  "infoInEstimates" : [

    "extent", 

    "count"

  ], 

  "useStandardizedQueries" : true, 

  "geometryType" : "esriGeometryPoint", 

  "minScale" : 0, 

  "maxScale" : 0, 

  "extent" : {

    "xmin" : -17811118.526923772, 

    "ymin" : -15538711.096309224, 

    "xmax" : 17811118.526923772, 

    "ymax" : 15538711.096309224, 

    "spatialReference" : {

      "wkid" : 102100, 

      "latestWkid" : 3857

    }

  }, 

  "drawingInfo":{"renderer":{"type":"simple","symbol":{"type":"esriPMS","url":"RedSphere.png","imageData":"iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6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wMWMusEnKpn5hyo48pj9gLe4SNG9QoGGLAk8z5XiaJUd99u8122/IpBA2K9BGg2vWWKAvRYVeLzEa7E1R422m2+MsSTem97nSYnfKyN6/mzATv7AUgqcMrUnmaFlLX3ysM0fj+t/b5lQLtK22QEfyAmiSLKFZpUJ7kBRPXKW4HqCYynWVHKSG2LkyZex1uO1mZM9lKem9Tx9jjY5iNEYo0bKMhn7ZAu0r6H5PpLXCAq0rKJClSjSGynE/QIkrQYqBPe6S2X+AJsY2Ped6iWZk6RlL0c2r5szofRsO9R5S1IfQLRCpQL1aifoYFerpsbkuTImaUJXuXIDiH6/Ys8vm3Mg8L2i20YqsO7fItKLcSXyn0kXccclVqv3MS6at9JU/Ox+ouns+SF6Z4cSupz7l8+z1ucs7LF1AQjOdxfGZzmx8Iu1TRcfnrioICAQEAgIBgYBAQCAgEBAICAQEAgIBgYBAQCAgEBAICAQEAv8H44b/6ZiGvGAAAAAASUVORK5CYII=","contentType":"image/png","width":15,"height":15}}}, 

  "allowGeometryUpdates" : true, 

  "hasAttachments" : true, 

  

  "attachmentProperties" : [

    {

      "name" : "id", 

      "fieldName" : "ATTACHMENTID", 

      "isEnabled" : true

    }, 

    {

      "name" : "globalId", 

      "fieldName" : "AttachmentGlobalID", 

      "isEnabled" : true

    }, 

    {

      "name" : "name", 

      "fieldName" : "ATT_NAME", 

      "isEnabled" : true

    }, 

    {

      "name" : "size", 

      "fieldName" : "DATA_SIZE", 

      "isEnabled" : true

    }, 

    {

      "name" : "contentType", 

      "fieldName" : "CONTENT_TYPE", 

      "isEnabled" : true

    }, 

    {

      "name" : "keywords", 

      "fieldName" : "Keywords", 

      "isEnabled" : true

    }, 

    {

      "name" : "exifInfo", 

      "fieldName" : "ExifInfo", 

      "isEnabled" : true

    }

  ], 

  "htmlPopupType" : "esriServerHTMLPopupTypeNone", 

  "hasM" : true, 

  "allowUpdateWithoutMValues" : true, 

  "hasZ" : false, 

  "objectIdField" : "OBJECTID", 

  "uniqueIdField" : 

  {

    "name" : "OBJECTID", 

    "isSystemMaintained" : true

  }, 

  "globalIdField" : "", 

  "typeIdField" : "", 

  "fields" : [

    {

      "name" : "OBJECTID", 

      "type" : "esriFieldTypeOID", 

      "alias" : "OBJECTID", 

      "sqlType" : "sqlTypeOther", 

      "nullable" : false, 

      "editable" : false, 

      "visible" : true, 

      "domain" : null, 

      "defaultValue" : null

    }, 

    {

      "name" : "Field1", 

      "type" : "esriFieldTypeString", 

      "alias" : "Field1", 

      "sqlType" : "sqlTypeOther", 

      "length" : 256, 

      "nullable" : true, 

      "editable" : true, 

      "visible" : true, 

      "domain" : null, 

      "defaultValue" : null

    }, 

    {

      "name" : "Field2", 

      "type" : "esriFieldTypeString", 

      "alias" : "Field2", 

      "sqlType" : "sqlTypeOther", 

      "length" : 256, 

      "nullable" : true, 

      "editable" : true, 

      "visible" : true, 

      "domain" : null, 

      "defaultValue" : null

    }

  ], 

  "indexes" : [

    {

      "name" : "Test_Point_Layer_TESTING_Shape_sidx", 

      "fields" : "Shape", 

      "isAscending" : false, 

      "isUnique" : false, 

      "description" : "Shape Index"

    }, 

    {

      "name" : "PK__Test_Poi__F4B70D85571405E5", 

      "fields" : "OBJECTID", 

      "isAscending" : true, 

      "isUnique" : true, 

      "description" : "clustered, unique, primary key"

    }

  ], 

  "dateFieldsTimeReference" : {

    "timeZone" : "UTC", 

    "respectsDaylightSaving" : false

  }, 

  "preferredTimeReference" : null, 

  "types" : [], 

  "templates" : [

    {

      "name" : "New Feature", 

      "description" : "", 

      "drawingTool" : "esriFeatureEditToolPoint", 

      "prototype" : {

        "attributes" : {

          "Field1" : null, 

          "Field2" : null

        }

      }

    }

  ], 

  "supportedQueryFormats" : "JSON, geoJSON, PBF", 

  "supportedAppendFormats" : "sqlite,geoPackage,shapefile,filegdb,featureCollection,geojson,csv,excel,imageCollection", 

  "supportedExportFormats" : "csv,shapefile,sqlite,geoPackage,filegdb,featureCollection,geojson,excel", 

  "supportedSpatialRelationships" : [

    "esriSpatialRelIntersects", 

    "esriSpatialRelContains", 

    "esriSpatialRelCrosses", 

    "esriSpatialRelEnvelopeIntersects", 

    "esriSpatialRelIndexIntersects", 

    "esriSpatialRelOverlaps", 

    "esriSpatialRelTouches", 

    "esriSpatialRelWithin", 

    "esriSpatialRelDisjoint", 

    "esriSpatialRelRelation"

  ], 

  "supportedContingentValuesFormats" : "JSON, PBF", 

  "supportedSyncDataOptions" : 4, 

  "hasStaticData" : false, 

  "maxRecordCount" : 2000, 

  "standardMaxRecordCount" : 32000, 

  "standardMaxRecordCountNoGeometry" : 32000, 

  "tileMaxRecordCount" : 8000, 

  "maxRecordCountFactor" : 1, 

  "capabilities" : "Create,Delete,Query,Update,Editing"

}
	]
	}

 

Add to your exsiting service layer. So here is a dummy one I set up:

Before

MarkC1_4-1658655427377.png

Add to Definition:

MarkC1_5-1658655464724.png

Remove the json already there and paste your edited json from above.

MarkC1_6-1658655557380.png

Paste in your edited json from above and you should see this response if successful:

MarkC1_7-1658655664607.png

 

 

 

 

 

 

 

RyanTucker
Regular Contributor

@MarkC1  I was able to get it to work with your example, and subsequently my field schema after some substitution. THank you!

I also found this Hosted Features Services Reference page on github which was a tremdous help. Apparently for table name you dont need to use db_  and user_ . 

 

/* Create Point layer example from GitHub Link in post */
{
    "layers": [{
		"currentVersion": 10.51,
		"id": 0,
		"name": "Point layer",
		"type": "Feature Layer",
		"displayField": "",
		"description": "",
		"copyrightText": "",
		"defaultVisibility": true,
		"editingInfo": {
			"lastEditDate": null
		},
		"relationships": [],
		"isDataVersioned": false,
		"supportsAppend": true,
		"supportsCalculate": true,
		"supportsTruncate": true,
		"supportsAttachmentsByUploadId": true,
		"supportsAttachmentsResizing": true,
		"supportsRollbackOnFailureParameter": true,
		"supportsStatistics": true,
		"supportsAdvancedQueries": true,
		"supportsValidateSql": true,
		"supportsCoordinatesQuantization": true,
		"supportsApplyEditsWithGlobalIds": false,
		"advancedQueryCapabilities": {
			"supportsPagination": true,
			"supportsPaginationOnAggregatedQueries": true,
			"supportsQueryRelatedPagination": true,
			"supportsQueryWithDistance": true,
			"supportsReturningQueryExtent": true,
			"supportsStatistics": true,
			"supportsOrderBy": true,
			"supportsDistinct": true,
			"supportsQueryWithResultType": true,
			"supportsSqlExpression": true,
			"supportsAdvancedQueryRelated": true,
			"supportsCountDistinct": true,
			"supportsLod": true,
			"supportsReturningGeometryCentroid": false,
			"supportsQueryWithDatumTransformation": true,
			"supportsHavingClause": true,
			"supportsOutFieldSQLExpression": true
		},
		"useStandardizedQueries": true,
		"geometryType": "esriGeometryPoint",
		"minScale": 0,
		"maxScale": 0,
		"extent": {
			"xmin": -20037508.342788905,
			"ymin": -8175201.3721496435,
			"xmax": -10018754.171394452,
			"ymax": 12175461.54272524,
			"spatialReference": {
				"wkid": 102100
			}
		},
		"drawingInfo": {
			"renderer": {
				"type": "simple",
				"symbol": {
					"type": "esriPMS",
					"url": "RedSphere.png",
					"imageData": "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQBQYWludC5ORVQgdjMuNS4xTuc4+QAAB3VJREFUeF7tmPlTlEcexnve94U5mANQbgQSbgiHXHINlxpRIBpRI6wHorLERUmIisKCQWM8cqigESVQS1Kx1piNi4mW2YpbcZONrilE140RCTcy3DDAcL/zbJP8CYPDL+9Ufau7uqb7eZ7P+/a8PS8hwkcgIBAQCAgEBAICAYGAQEAgIBAQCAgEBAICAYGAQEAgIBAQCDx/AoowKXFMUhD3lQrioZaQRVRS+fxl51eBTZUTdZ41U1Rox13/0JF9csGJ05Qv4jSz/YPWohtvLmSKN5iTGGqTm1+rc6weICOBRbZs1UVnrv87T1PUeovxyNsUP9P6n5cpHtCxu24cbrmwKLdj+osWiqrVKhI0xzbmZ7m1SpJ+1pFpvE2DPvGTomOxAo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AgEBAICAQEAv8H44b/6ZiGvGAAAAAASUVORK5CYII=",
					"contentType": "image/png",
					"width": 15,
					"height": 15
				}
			}
		},
		"allowGeometryUpdates": true,
		"hasAttachments": true,
		"htmlPopupType": "esriServerHTMLPopupTypeNone",
		"hasM": false,
		"hasZ": false,
		"objectIdField": "OBJECTID",
		"uniqueIdField": {
			"name": "OBJECTID",
			"isSystemMaintained": true
		},
		"globalIdField": "",
		"typeIdField": "",
		"fields": [{
			"name": "OBJECTID",
			"type": "esriFieldTypeOID",
			"alias": "OBJECTID",
			"sqlType": "sqlTypeOther",
			"nullable": false,
			"editable": false,
			"domain": null,
			"defaultValue": null
		}],
		"indexes": [],
		"types": [],
		"templates": [{
			"name": "New Feature",
			"description": "",
			"drawingTool": "esriFeatureEditToolPoint",
			"prototype": {
				"attributes": {}
			}
		}],
		"supportedQueryFormats": "JSON, geoJSON",
		"hasStaticData": false,
		"maxRecordCount": 2000,
		"standardMaxRecordCount": 32000,
		"tileMaxRecordCount": 8000,
		"maxRecordCountFactor": 1,
		"capabilities": "Query,Editing,Create,Update,Delete,Sync",
		"syncEnabled": true,
		"adminLayerInfo": {
			"geometryField": {
				"name": "Shape",
				"srid": 102100
			}
		}
	}],
	"tables": []
}

 

RyanTucker
Regular Contributor

@MarkC1 just FYI; I have a case open with ESRI to try and rectify this issue where we need to edit the JSON through Assistant to make the added features layers show up on the feature service content page.

0 Kudos
DougGreen
Frequent Contributor

Any word if this case is resolved. I've just successfully added layers to a hosted feature layer and they show up in the rest services directory but not on the Item overview page.

DougGreen_0-1692297409825.png

 

0 Kudos
RyanTucker
Regular Contributor

Unfortunately, no.


 

0 Kudos