AnsweredAssumed Answered

arcpy calculatefieldmanagement domain field

Question asked by bill@poconogis.com on Jun 16, 2020
Latest reply on Jun 18, 2020 by bill@poconogis.com

Hi, using arcpy I'm trying to calculate a field that's using a domain. I'm actually calculating 2 fields, one after the other.

The first one works but the second one doesn't set it's new value. No error messages. If I'm not using python and just field calculate it "USER" puts "User-Derived" in the field. However my script just doesn't.

ArcMap 10.6 with a File GeoDataBase Featureclass

 

Any ideas?

 

 

try:
# Execute CalculateField

# this one works well.
arcpy.CalculateField_management(ug, "MEASUREDLENGTH", dist, "PYTHON_9.3")
arcpy.AddMessage("Calc'd MEASUREDLENGTH")

 

# this one is supposed to end up with "User-Derived" but doesn't do anything
arcpy.CalculateField_management(ug, "LENGTHSOURCE", "USER", "PYTHON_9.3")
arcpy.AddMessage("Calc'd LENGTHSOURCE")

 

Domain Key/Value:
FM Field Measurement
MS Mapping System
USER User-Derived
WM Windmil
WO Work Order Package

Outcomes