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
Solved! Go to Solution.
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.
For anyone else that finds this page and tries to follow the work around instructions for BUG-000145205, the instructions on that page are not correct. Those instructions have you create a new hosted feature layer (which defeats the purpose of using "Add to Definition"). Correct instructions below:
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.
What are you sending?
"Incorrect syntax near the keyword 'on'."
Seems to me like it's something you're sending to the API.
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.
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?
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
How to upload file while using AddToDefination API ?