My problem is as follows:
I'm using model builder for all of this.
Does Spatial Join do this sometimes where it can overwrite the Allow Null Values flag from No to Yes?
Is there any way for me to prevent that?
Is the easier way to just join fields based on UID later?
What's a solution to this?
I had an idea where I could do this in python and use search cursors/ update cursors to just NOT calculate field on records where any of my inputs are NULL but that could take a while for me to set up compared to this version in model builder. This is mainly due to my own limited experience.
I also feel quite unaware of logical operations from inside model builder / the field calculator, so maybe the solution is something like "if input field == NULL" or "if NOT inputField:" from within my field calculator, possibly expanding that to change the value of a variable to 0 if that condition is met, like a = inputField if the inputField has a number in it and a=0 if the input field doesn't have a number in it. Any tips on how to do that logical test if my above solution isn't the right way to do this?
Solved! Go to Solution.
Amazing what a night's sleep will do:
Using field calculator and learning how to do pre-logic scripting, I added this and this seems to work perfectly.
def myTest(dest,test,test1):
if test==None:
a = dest + 0
return a
else:
a = dest + test + test1
return a
Amazing what a night's sleep will do:
Using field calculator and learning how to do pre-logic scripting, I added this and this seems to work perfectly.
def myTest(dest,test,test1):
if test==None:
a = dest + 0
return a
else:
a = dest + test + test1
return a