ArcGIS Pro 2.3
I want to create a standalone script which runs outside of ArcGIS Pro (for automation purposes), which selects features (with blank attributes) in a feature class and runs calculate field on those selections.
The code below doesn't work. It updates all fields, not the selected ones.
import arcpy
arcpy.management.SelectLayerByAttribute(r"C:\Automation\Categories\Coal\Coal_automation.gdb\CLAIMS", "NEW_SELECTION", "Claim_Spend_in_£ = ''", None)
arcpy.management.CalculateField(r"C:\Automation\Categories\Coal\Coal_automation.gdb\CLAIMS", "Claim_Spend_in_£", '"Unrecorded"', "PYTHON3", None)
print ("Done")
How can I write the code to run calculate field on a selection?