So I started to work with ArcGis and Python. And I got a task.
This is what I have to do:
Check that all the objects have filled Glb_Cpy field. If found empty object, then this field has to be filled by Glb_ID value.
So I did it. But now I have to create statement, if fc doesn`t have Glb_ID or Glb_Cpy fields, then arcpy.AddError("Invalid Data") ->return and script stops. else arcpy.AddMessage("Valid Data") and complete the script. I know that I`m thinknig that i need to use arcpy.Exists , arcpy.ListFields or arcpy.Describe ... I hope someone understood me.
Waiting any suggestions! Thanks!
desc = arcpy.Describe(fc)
with arcpy.da.UpdateCursor(fc, ['Glb_ID', 'Glb_Cpy'], 'Glb_Cpy IS NULL') as cursor:
for row in cursor:
row = row
# Update the cursor with the updated list
if __name__ == "__main__":