Hi~~~
def Reclass(arg):
if arg in ["222", "333"]:
return "<Null>"
else:
return arg
I want the results as shown below.
Solved! Go to Solution.
Do not return "<NULL>" because it will not set a field to SQL NULL, it will set a field to a text string that says "<NULL>". If you want to set a field to SQL NULL, you want to return None.
Nearly there, but you need to pass in 2 arguments.
#prelogic codeblock
def Reclass(arg1, arg2):
if arg1 in ["222", "333"]:
return "<Null>"
else:
return arg2
#code
Reclass(!NAME!, !PNAME!)
Thank you so much~~~~~~
Do not return "<NULL>" because it will not set a field to SQL NULL, it will set a field to a text string that says "<NULL>". If you want to set a field to SQL NULL, you want to return None.
Thank you