I have a feature service that has existed for a couple years. It has never had a definition query, nor did I want one. Recently, I had to make some data edits to the data via a Python script. That seemed to work as expected. To test whether the operation worked successfully I decided to open ArcGIS Pro, load the feature service into the table of contents and set a definition query to review the data that had been changed. Everything seemed fine so I removed the layer from Pro and closed it down.
Now the feature service on ArcIGIS Online is filtered to that definition query!!!??? Thousands of records have disappeared. How is this even a thing???? How is it possible that a local definition query showed up on ArcGIS online? Why is this even an option?
Regardless of whatever stupid reason made this happen, how do I remove the definition query from the feature service? This is a public facing service that needs to be corrected right now.
Solved! Go to Solution.
No thoughts on how it got that way unless someone changed it in the visualization tab, but, it can be removed there.
Go to the items Detail page, Visualization Tab, select the layer in the TOC and then the Filter button on the right.
You should be able to clear/modify any 'saved' filters here. Just be sure to "Save" in the upper left so the changes stick.
R_
I suspect some other intervening issue is at play here, I don't think this is possible. Because I was curious I just played around a little with a hosted feature service to see if i could replicate the result you describe with nothing I did in Pro having an effect on the hosted service in AGOL. To get back to where things are supposed to be, Is it possible for you to overwrite your feature service with your layer (no definition query version) in Pro?
I think this happened to me once before a few years ago and I thought I was losing my mind. No, I don't want to overwrite if I can avoid it because this layer and its views are currently being used in several apps including Survey123, Field Maps, and Experience Builder.
I am so careful not to republish or overwrite any layers in ArcGIS Online. To be honest, I haven't performed that function in a couple years so there is no way that this is how the definition query came to be part of the feature service.
I thought there might be some sort of way to remove the definition in the Admin page of the feature service, but I can't find any reference yet to this query. Yet, when I load this layer fresh into a Pro Project, there the definition query is again even though I delete it from the layer and save Pro.
No thoughts on how it got that way unless someone changed it in the visualization tab, but, it can be removed there.
Go to the items Detail page, Visualization Tab, select the layer in the TOC and then the Filter button on the right.
You should be able to clear/modify any 'saved' filters here. Just be sure to "Save" in the upper left so the changes stick.
R_
@RhettZufelt Thank you so much. That did the trick. I never would have thought to look under the Visualization tab since I never use it. That just makes me even more curious about how it got there since I don't use that tab and I don't know of anyone else that would have implemented the exact query I was using in in Pro. Anyway, that doesn't matter now. I can move on to other things. Thanks again.