Capability 'Query' is not set on the layer.

4359
5
11-10-2021 12:27 PM
DirkVandervoort
Occasional Contributor II

In ArcGIS Enterprise 10.8.2. I have a Feature Layer that is a hosted feature service that was created by publishing a Survey123 from Survey123 Connect. It is hosted in the ArcGIS DataStore. The survey/feature layer has over 400 questions/fields. Unbeknownst to us until after the Survey123 had been in production and collected lots of data, the capabilities did not include the Query Capability (we're not sure exactly when this happened or if it's always been that way). Although this has not affected Survey123, the maps, and the dashboards, the APIs are affected affected. because there is no query capability. I cannot query the Feature Layer in code. I have attempted to use the REST API, ArcPy, and the Python API for ArcGIS.

In all cases I get an error with the content "Capability 'Query' is not set on the layer.". The REST API exposes it as a 500 error.

I can tell that there is no query capability by looking at the Feature Layer's REST endpoint. At the bottom of the page under "Supported Operations", there is no "Query".

DirkVandervoort_0-1636575771865.png

 

All I want to do is rescue the Feature Layer by enabling Query. This is not documented anywhere that I can find. The other options to migrate and publish a new Feature Layer is unappealing because we already have several month of production data, and because there is no query capability, I cannot script it.

TIA

 

5 Replies
mettegreve
New Contributor III

I'm having the same issue, did you ever figure this one out?

tc_ton
by
New Contributor

I'm also experiencing the same issue from a hosted feature layer created form Survey123. Wondering if anyone has figured it out. Thanks. 

MJBiazar
Esri Contributor

Hi @tc_ton, for hosted feature layers in ArcGIS Online, currently, if the layer's editing settings only allows "Add" and  "What features can editors see?",  'Editors can't see any features, even those they add.' option is selected, the Query capability will be disabled for the layer.

2022-05-10_19-03-43.png

2022-05-11_8-24-10.png

When the query is disabled, if the layer is opened in Map Viewer Classic, features won't draw and you get "Accessing data failed" error if you try to open the attribute table. 

2022-05-10_19-02-19.png

 

In Map Viewer, features are visible on the map but you don't see the option to open the attribute table. 

2022-05-10_19-02-00.png

 

If you try to use this layer as the data source in some of the apps (e.g. Dashboard), you may get an error and data from this layer may not be accessible by the app. 

2022-05-10_19-03-17.png

 

Since Survey123 3.14, the feature layers that are created for surveys have these editing settings by default. This was an intended change to provide the most secure data experience for survey creators by default and allow them to decide what permissions they want to open on their data.

You can enable the query capability by changing the layer settings:

  • Enable 'Update' or 'Delete'.
  • Change the option for 'What features can editors see?' to 'Editors can see all features' or  'Editors can only see their own features (requires editor tracking).'
  • Disable editing.

 

Best,

MJ

SitKlin
New Contributor

Big Thanks

0 Kudos
MJBiazar
Esri Contributor

Hi @tc_ton, for hosted feature layers in ArcGIS Online, currently, if the layer's editing settings only allows "Add" and  "What features can editors see?",  'Editors can't see any features, even those they add.' option is selected, the Query capability will be disabled for the layer.

2022-05-10_19-03-43.png

2022-05-11_8-24-10.png

When the query is disabled, if the layer is opened in Map Viewer Classic, features won't draw and you get "Accessing data failed" error if you try to open the attribute table. 

2022-05-10_19-02-19.png

 

In Map Viewer, features are visible on the map but you don't see the option to open the attribute table. 

2022-05-10_19-02-00.png

 

If you try to use this layer as the data source in some of the apps (e.g. Dashboard), you may get an error and data from this layer may not be accessible by the app. 

2022-05-10_19-03-17.png

 

Since Survey123 3.14, the feature layers that are created for surveys have these editing settings by default. This was an intended change to provide the most secure data experience for survey creators by default and allow them to decide what permissions they want to open on their data.

You can enable the query capability by changing the layer settings:

  • Enable 'Update' or 'Delete'.
  • Change the option for 'What features can editors see?' to 'Editors can see all features' or  'Editors can only see their own features (requires editor tracking).'
  • Disable editing.

 

Best,

MJ