AnsweredAssumed Answered

Null if Statement in Calculated Field

Question asked by thomaskelly75 on Feb 13, 2020
Latest reply on Feb 13, 2020 by bixb0012

I have a column in an attribute table that has a mixture of nulls and data. I wish to create a new column that will return a "yes" if there is data in the column being checked and "no" if it is a null. I have tried a variety of python functions but I keep getting an error similar to the below:


ERROR 000539: File "<expression>", line 1
SyntaxError: invalid syntax
Failed to execute (CalculateField).   


I have tried the following :

X = updateValue(!field!)


def updateValue(value):
   if value == None:
   return 'no'
   else: return "yes"


Any help would be most appreciated.