Frequently asked question

How can I check for null values in the Field Calculator using Python?

Last Published: November 16, 2021


Starting at ArcGIS for Desktop 10.1, null values in an attribute table are returned as the string 'None' in the Field Calculator using Python. Knowing this, an if/elif statement can be used to find whether values are null or not. Here is an example script that checks if a field contains null values:


Expression Type:

Code Block:
def findNulls(fieldValue):
    if fieldValue is None:
        return "null values"
    elif fieldValue is not None:
        return "no nulls here"

Article ID:000011740

  • ArcMap

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic