ArcGIS Pro Calculate Field (using SQL) Not Honoring Selection

3016
10
Jump to solution
03-27-2019 01:41 PM
KyleBalke__GISP
Occasional Contributor III

It appears that the Calculate Field tool when using the SQL expression type in ArcGIS Pro 2.3.1 does not honor a selection set.  Is this functionality not supported or this a bug?  I could not find any mention of this in the ArcGIS Pro help.

0 Kudos
1 Solution

Accepted Solutions
KoryKramer
Esri Community Moderator

Best practice: try to not have duplicate layer names in a map (but I know there are reasons you might want that, so...)

This issue was discussed here: https://community.esri.com/message/833996-re-applying-field-calculator-only-on-selected-features?com...

With duplicate layer names, if you have a selection on the second layer, and if you've right-clicked the field header to open the Calculate Field tool, the tool gets populated with the first layer.  As a user, you could switch it over to the second layer, but why would you - you instantiated the tool from the second layer, right?

Anyway, we have a fix for that in Pro 2.4.  So until then, not having duplicate layer names will help avoid issues.  I hope this helps!

View solution in original post

10 Replies
KyleBalke__GISP
Occasional Contributor III

After additional testing I have found that this issue also occurs when using the Python 3 expression type and leads me to believe this is a bug (and a significant one at that).

0 Kudos
Robert_LeClair
Esri Notable Contributor

I'm using AGP 2.3.2 and tested this with Arcade and Python and it worked as expected.  What was unexpected is that using SQL expressions on a file geodatabase feature class threw "ERROR 002536:  Table <FC> does not support or is in a state to support SQL expressions."  Querying this error, the Help page said SQL expressions are only supported on feature service and enterprise geodatabase data.  That's a significant change to me!

0 Kudos
KoryKramer
Esri Community Moderator

Robert, it's documented that SQL expression type is only for 

https://pro.arcgis.com/en/pro-app/tool-reference/data-management/calculate-field.htm

Kyle Balke, GISP‌ it would be important to provide steps, more details, and screenshots to understand what you're seeing especially since Robert says he tried with Arcade and Python and it works as expected.

You don't have layers with the same name in a map do you?

Robert_LeClair
Esri Notable Contributor

Very true Kory - saw that after the ERROR message was thrown.  Used to my ArcMap days of SQL expressions is all - AGP is a different application as we know.  Thx!

KyleBalke__GISP
Occasional Contributor III

I am performing the Field Calculation against a hosted feature service (hence using the SQL expression type).  When I select one or more records and perform the calculation it updates all records in the table not just the selected records.  I just added the hosted feature layer to a new map in Pro and the selection set was honored.  Odd issue indeed...seems as though the layer in the map had an issue/corruption?

0 Kudos
KyleBalke__GISP
Occasional Contributor III

Kory I did have two layers with the same name in the map.  Once I removed one of the layers the selection set was honored!

Thanks

0 Kudos
KoryKramer
Esri Community Moderator

Best practice: try to not have duplicate layer names in a map (but I know there are reasons you might want that, so...)

This issue was discussed here: https://community.esri.com/message/833996-re-applying-field-calculator-only-on-selected-features?com...

With duplicate layer names, if you have a selection on the second layer, and if you've right-clicked the field header to open the Calculate Field tool, the tool gets populated with the first layer.  As a user, you could switch it over to the second layer, but why would you - you instantiated the tool from the second layer, right?

Anyway, we have a fix for that in Pro 2.4.  So until then, not having duplicate layer names will help avoid issues.  I hope this helps!

KyleBalke__GISP
Occasional Contributor III

This complete makes sense and really was laziness on my part.  I truly appreciate the feedback!

Best,

Kyle

KoryKramer
Esri Community Moderator

I'm glad that helped, Kyle.  If you think it was the correct answer, could you please mark it to keep this thread clean?

Thank you.

0 Kudos