ArcMap Definition Queries When Publishing to AGOL Hosted Layers

3107
3
10-13-2016 09:29 AM
GarethBaker
New Contributor II

Has there been a recent change in behaviour with ArcGIS Online when publishing a feature layer in ArcMap that has a definition query applied to it? I could have sworn that a few months ago when I published a layer with a query that it just ignored the query and published all the data anyway.  This ties up with the help page

About hosted web layers—ArcGIS Online Help | ArcGIS 

Which states:

Be aware that definition queries you apply to layers in ArcMap or ArcGIS Pro are only applied when querying, not when the data is published. All data is published and uploaded to ArcGIS Online. If you want only a subset of the data to be published to and stored in ArcGIS Online, you must export the subset of the data to another feature class and publish that.

However I have tried uploading layers with definition queries in the last couple of weeks and it now seems to honour the definition query and only upload the filtered records. Is it just the case that the documentation is out of date?

I had wondered if it was to do with the version of ArcGIS Desktop but I get the same result in both 10.1 and 10.3.1.

Regards

Gareth

Tags (2)
3 Replies
Team_150Water_en_Bodem
New Contributor

dito

0 Kudos
MarkSenne
New Contributor II

It seems that the layer definition query is being honored, even so that when you change the name of the layer on the AGOL side to something else in an edit session it will completely disappear since the query no longer adheres to the name of the layer in the attribute table. 

Am I missing something somewhere that will allow me to edit the definition query within AGOL layer settings? I can't seem to find anything.

0 Kudos
KellyGerrow
Esri Frequent Contributor

Instead of applying a definition query when publishing, I would recommend using a hosted feature layer view:

https://doc.arcgis.com/en/arcgis-online/manage-data/create-hosted-views.htm

This way you can manage the definition query (view definition) through the ArcGIS Online interface:

https://doc.arcgis.com/en/arcgis-online/manage-data/set-view-definition.htm

0 Kudos