I have created a new field in the attribute table Called "new_labes".
I then right-click on 'new_labels' to open the calculate field tool I then concatenate other fields such as SAF or SRM in the attribute table. the result is giving me the Coded name and not the description as it was previously was viewed in the attribution table for SAF or SRM.
Before : SAF=pine tree and After: In new_labels SAF value is seen as 001
I did notice that SAF does have a domain type as coded value domain which 000 = pine tree
how do I concatenate fields and get results of what I see in the attribute table and not the coded values in the new field created new_labels?
The GDB's domains have a code and a description. The calculator is grabbing the code instead of the description.
In the field calculator, using Python 3 as Expression Type, use the following code (replace the values in red with the relevant values):
getDomain(!SourceField1!, !SourceField2!, 'DomainName')
In the Code Block:
gdb = r"yourGDB.gdb"
dom_desc = [d.codedValues for d in arcpy.da.ListDomains(gdb) if d.name == DomainName]
for code in dom_desc.items():
domDescription1 = code
domDescription2 = code
Concat = domDescription1+domDescription2
You can find the domain name in the GDB's domain table.
Hope this helps,
The problem I'm still having is how do I use multiple domains? If Field one has one domain ex: "EV_SRM_COVER_TYPE" and field two has a separate domain listed ex: "EV_SAF_COVER_TYPE" in GDB.
Field 1 = !SRM_COVER_TYPE!
Field 2 = !SAF_COVER_TYPE!
the result is still 000-111 after I concatenate but I need the descriptions instead of the code