Select to view content in your preferred language

Feature layer added to Feature Service does not show in AGOL

3438
16
Jump to solution
06-15-2022 01:53 PM
MarkC1
by
Occasional 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
16 Replies
mikAMD
by
Occasional Contributor III

I talked to ESRI support about this and they finally told me it was a known bug: https://support.esri.com/fr-fr/bug/new-layers-added-to-a-service-via-the-rest-endpoint-do-bug-000145...

If you need to add the layer/table to a map, you can do it manually as explained at the bottom of the bug page.

0 Kudos
ANRGIS
by
Occasional Contributor

Hello,

I was successful testing this on a newly created hosted feature layer but when I try and add it to my production hosted feature layer I get this message:

{
  "error" : 
  {
    "code" : 400, 
    "message" : "Unable to add feature service definition.", 
    "details" : [
      "Incorrect syntax near the keyword 'on'."
    ]
  }
}

I ran the JSON through Lint and it was valid. Any insight on why?

The hosted feature layers are deployed from an ARCGIS Solution and there's bunch of existing layer and tables.

 

 

 

0 Kudos
mikAMD
by
Occasional Contributor III

What are you sending?


"Incorrect syntax near the keyword 'on'."


Seems to me like it's something you're sending to the API.

0 Kudos
ANRGIS
by
Occasional Contributor

Yep. It's JSON for adding a new layer using the addToDefinition parameter like @MarkC1 outlines. Works for newly created layer but not the one I want.

0 Kudos
mikAMD
by
Occasional Contributor III

Are you sure you are in the right thread? This is for successfully sent data through the API where the layer/table appears afterwards when querying the API but does not show on the AGOL interface.

Anyway, check what you are sending to the API and search for "on" as is suggested in your error message. Possibly a SQL query?

0 Kudos
ANRGIS
by
Occasional Contributor

You're right, not exactly the right thread but the thread has best explanation executing the add layer definition. "on" shows up about a hundred times, I don't think the error is helpful in this case. Thanks

0 Kudos
AvinashDalvi_
New Contributor III

How to upload file while using AddToDefination API ? 

0 Kudos