AnsweredAssumed Answered

Problem Setting Label Expression in Arcpy

Question asked by jonmulder on Dec 24, 2013
Latest reply on Dec 24, 2013 by hua17
I'm trying to set a label expression to a field ("StateWellNumber") in my table.  I have the following code but I get an error message saying "name 'StateWellNumber' is not defined".

Any ideas?

Jon Mulder

LayerFileLocation = "H:\Documents\GIS\HydstraData" LayerName = "WellPoints.lyr" ##Show labels for WellPoints. arcpy.mapping.Layer(os.path.join(LayerFileLocation,LayerName)).supports("LABELCLASSES") arcpy.mapping.Layer(os.path.join(LayerFileLocation,LayerName)).showLabels = True arcpy.mapping.Layer(os.path.join(LayerFileLocation,LayerName)).labelClasses.expression =  [StateWellNumber] 

Outcomes