Using Field Calculator to Change a row with domains

864
2
06-13-2017 11:15 AM
ScottWagoner
New Contributor II

I have a row with domains labeled Manholes. This has a drop down box with 3 options.  In the same table I have another row labeled type of manholes.  This has the same options as Manholes but instead of being a dropdown selection, it is just text.  I need to move the information in "type of manholes" to "Manholes".  I have tried to write a simple script which basically said "if type of manholes = a, then manholes = 1" but I cannot figure out how to get it to work.  I am doing it in Python and have limited knowledge.

Thanks.

Tags (1)
0 Kudos
2 Replies
AbdullahAnter
Regular Contributor II

I think that 3 options of domain is easy to select by attribute  the records that have same value then field calculator it. Just you will make 3 select by attribute then field calculator.

Note

Use the code number for coded domain in filed calculator value.

0 Kudos
ScottWagoner
New Contributor II

After looking closer, I got something to work:

def Something(Type of manholes):
  if Type of manholes == "A":
    return 1
  elif Type of manholes == "B":
    return 2
  elif Type of manholes == "C":
    return 3
  else:
    return "null"