I have two columns: "Street1" and "Verified".

I need to check all rows in Street1 to see if they are of string "0" or null. I've attempted to come up with something in Field Calculator but it is returning an error saying the field [Verified] is not nullable

enter image description here

  • If it is shape file try to add another return ""
    – FelixIP
    Dec 9, 2016 at 22:16
  • How do you mean?
    – TacoB0t
    Dec 9, 2016 at 22:17
  • One more line at the end
    – FelixIP
    Dec 9, 2016 at 22:32
  • Code as text rather than just picture, please?
    – PolyGeo
    Dec 10, 2016 at 1:08
  • Alternatively, without the code block: return 'V' if !Street! in [None, "0"] else 'some other value maybe None or ""'
    – Paul
    Dec 10, 2016 at 17:18

2 Answers 2


The problem is that you are not explicitly returning any value in the case that your condition(s) are not met. In this case it will implicitly return NULL (None) for any value of "Street1" that is not "0" or None, but NULLs are not permitted in the "Verified" field for which (I'm guessing) you are running this calculation.

You can cater for this by adding an else clause to your if, or just have a default return statement at the end where you make sure you default to returning something other than NULL (or None).

Something like:

def check(street):
    if street is None or street == "0":
        return "V"

    return "X"

(replace "X" with whatever non-"V" value you want - even return "" would be OK)

Alternatively, if you really want NULL values, and the dataset is a GDB that can handle NULL values, you will need to redefine the field properties to allow NULL values for the "Verified" field.


This method will replace null, empty or zero values with V. Otherwise it will return the street attribute.

def check(street):
    if street == "":
        return "V"
    elif street == "0":
        return "V"
    elif not street:
        return "V"
        return street

If you get the same error you'll need to remove (elif not street:/return "V").


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.