3

I am trying to update my Status field as seen below:

enter image description here

I want to change the Null and Existing values to Permanently Removed using the Python Parser; however, I am receiving an error.

Error message:

Can someone explain what I am doing wrong?

def updateName(sCode):
    if sCode == Null:
       status= 'Permanently Removed'
    elif sCode == 'Existing':
       status = 'Permanently Removed'
    else:
       status = None
    return status

enter image description here

1
  • 3
    A couple suggestions: 1.) change if sCode == Null: to if sCode is None: and make sure that the STATUS field does not contain coded values in its domain.
    – mmoore
    Commented Sep 13, 2016 at 15:12

1 Answer 1

5

You are so close. As mentioned by @mmore, use "is None" to find Null values. sCode is the variable for Status, therefore use that for the final condition.

See the link on how to use the field calculator.

def updateName(sCode):
    if sCode is None:
        return 'Permanently Removed'
    elif sCode == 'Existing':
        return 'Permanently Removed'
    else:
        return sCode

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.