Definition query not being honored with online feature layer

186
4
10-15-2020 09:37 AM
JasonJordan00
Occasional Contributor

I have had several instances this happening when I am pulling in a layer from portal or AGOL into my map through the catalog in Pro 2.5 and 2.6. If I set a definition query in the layer properties in the Pro map, geoprocessing tools do not seem to honor it. First time this happened I performed a field calculation on 50 records queried out but it ended up running on all 6,000 records. Is there an environment setting I am missing or has anyone else seen this behavior?

Reply
0 Kudos
4 Replies
Robert_LeClair
Esri Frequent Contributor

Jason - try this workflow and let's see what happens.  Instead of applying a Definition Query on the hosted feature layer (HFL), select by attribute those features you wish to run a GP tool on, right-click on the HFL, select Selection->Make Layer from Selected Features and do your GP work on the selection layer.  Is the result the same?  Please advise.

I don't see the behavior you described.  I selected a hosted feature layer from AGOL, built a Def Query, and ran the buffer tool on the hosted feature layer.  Only those features that were screened out by the Def Query had a polygon created for them.

Reply
0 Kudos
JasonJordan00
Occasional Contributor

I will try to make a new layer from selected and see what that does, but double checking that I also select the same records that I have queried out has been the failsafe. Two other people in my office have reported the same issue and it has caused some catastrophic data issues especially when running the field calculator processes more records than it was supposed to.

Reply
0 Kudos
Robert_LeClair
Esri Frequent Contributor

Thx for the update Jason.  One thing to note, towards the bottom of the Calculate Field GP tool to the left of the Run button is the "Enable Undo" slider that allows you to undo your field calculation if there is an error.  Might be helpful to prevent catastrophic data issues.

Reply
0 Kudos
JasonJordan00
Occasional Contributor

Yes we've been utilizing that.

Here's a snippet of time this morning where 'select by attributes' did not honor the definition query.

Reply
0 Kudos