Is it possible to perform a queryDomains on a hosted feature service in ArcGIS Enterprise?

1719
4
Jump to solution
01-25-2021 09:25 PM
ShawnPOWER
New Contributor III

In ArcGIS Enterprise 10.8.1 is it possible to perform a /queryDomains call via the REST API for a hosted feature service? I am currently not seeing it as a supported operation in the web interface. I am able to browse to the /queryDomains endpoint however off of the hosted feature service however I receive an error message when executing a GET\POST of "Error performing query domains operation". I haven't found any credible information so far as to whether it works or not. I am able to do this on a non-hosted feature service within the same environment without issue.

1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

I haven't been able to do so, either. I'd guess this is because QueryDomains hits the service itself, as an SDE-based service would share its domains across layers.

In hosted layers, however, domains apply at the layer level, and the layers within the service lack the supportsQueryDomains property. The best I have been able to do for hosted layers is to iterate over items in the {'fields': [...]} object and pull out items where {'domain':...} isn't null.

- Josh Carlson
Kendall County GIS

View solution in original post

4 Replies
jcarlson
MVP Esteemed Contributor

I haven't been able to do so, either. I'd guess this is because QueryDomains hits the service itself, as an SDE-based service would share its domains across layers.

In hosted layers, however, domains apply at the layer level, and the layers within the service lack the supportsQueryDomains property. The best I have been able to do for hosted layers is to iterate over items in the {'fields': [...]} object and pull out items where {'domain':...} isn't null.

- Josh Carlson
Kendall County GIS
ShawnPOWER
New Contributor III

Thank you @jcarlson for confirming your experience here as well and providing some more information.

I am interested in the work around you did by iterating over items in the fields object. I am seeing this information available in the layer query in ArcGIS Online but not unfortunately in ArcGIS Enterprise 10.8.1 on premises. Below is an example I see in ArcGIS Online today and on premises in 10.8.1 today. Is there some configuration missing maybe or is this just a newer feature in ArcGIS Online?

Example JSON for OBJECTID in ArcGIS Online:

"fields": [
{
"name": "OBJECTID",
"type": "esriFieldTypeOID",
"alias": "OBJECTID",
"sqlType": "sqlTypeOther",
"domain": null,
"defaultValue": null
},

 

Example JSON for OBJECTID in ArcGIS Enterprise 10.8.1 on premises (missing sqlType and domain it looks like):

"fields": [
{
"name": "objectid",
"type": "esriFieldTypeOID",
"alias": "ObjectID",
"defaultValue": null
},

 

0 Kudos
jcarlson
MVP Esteemed Contributor

We're on 10.8.1, and some layers have the domain given, some don't. Not exactly sure why, but I suspect it may have to do with how the layers were originally published.

I'd say just include a line that looks to see if there even is a "domain" key in the object, then move on to see if it's null or not.

- Josh Carlson
Kendall County GIS
ShawnPOWER
New Contributor III

I didn't realize the layer data contained it for some reason. Looks like I can call the hosted feature layer and just do a simple ?f=json on the layer itself. For example: ../rest/services/Hosted/hostedFeatureServiceNameHere/FeatureServer/0?f=json

Thanks again @jcarlson 

0 Kudos