Select to view content in your preferred language

ArcGIS Pro CalculateFields(multiple) bug?

748
2
02-10-2020 03:39 PM
JasonCeleste1
Emerging Contributor

I'm trying to use the Python arcpy.CalculateFields_management expression on selected features and it is calculating all features. Calculating individual fields from the table on selected features works fine. Could this be a bug or am I doing something wrong? Can't check in ArcMap because that expression is not supported. I am using Pro 2.5. 

0 Kudos
2 Replies
DanPatterson_Retired
MVP Emeritus

You indicated the (multiple) version of Calculate Fields

Did you incorporate SelectByAttributes or did you use a MakeFeatureLayer 

Calculate Fields (multiple)—Data Management toolbox | Documentation 

If you are running this in a script you need to make a featurelayer because a script has no concept that you have something selected

JasonCeleste1
Emerging Contributor

100% user error. I manually selected the features and then ran the script without MakeFeatureLayer. I have since added a MakeFeatureLayer line with my selection query before CalculateFields and now it's doing just what I need it to do.

Thanks!!