Select to view content in your preferred language

Definition query not being honored with online feature layer

1037
4
10-15-2020 09:37 AM
JasonJordan00
Frequent 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?

0 Kudos
4 Replies
Robert_LeClair
Esri Notable 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.

0 Kudos
JasonJordan00
Frequent 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.

0 Kudos
Robert_LeClair
Esri Notable 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.

0 Kudos
JasonJordan00
Frequent 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.

0 Kudos