<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Spatial Join in ModelBuilder overwriting Allow NULL values? in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/spatial-join-in-modelbuilder-overwriting-allow/m-p/777379#M1794</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My problem is as follows:&lt;/P&gt;&lt;P&gt;I'm using model builder for all of this.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I set up a blank feature class&lt;/LI&gt;&lt;LI&gt;I add fields to this blank feature class with names based on strings in a list, with the option Allow NULL values : No. Type: double, and immediately set their default value to 0. No records yet, it's all fine.&lt;/LI&gt;&lt;LI&gt;I append a line to this blank feature class (which has type: polyline) with schema type as: NO_TEST. The output is still "No" for all relevant fields, and they have their default value of 0.&lt;/LI&gt;&lt;LI&gt;I convert this line into a&amp;nbsp;bunch of equally long line segments. Each field is still "No" for NULL values and the default of 0 is listed for each record. (Generate points along line -&amp;gt; split line at points, this is fine)&lt;/LI&gt;&lt;LI&gt;I run a spatial join&amp;nbsp;on the output of 4 and a&amp;nbsp;featureclass that exists here and there along my line, with a "Within distance: 100 meters". I make sure that the field mapping still has everything set to "No" for NULL values, BUT&lt;/LI&gt;&lt;LI&gt;The output fields are now all Allow NULL Values: "Yes"&lt;UL&gt;&lt;LI&gt;My goal was to use the field calculator to grab the sum of a field from the joined featureclass and add it to a running total field in the target featureclass, I intended to get around an issue I was having wherein the target features that lacked a spatially joined feature would get NULL added to it, I think, and remove the value, causing me to eventually get ONLY NULL values for all of my relevant fields.&lt;/LI&gt;&lt;LI&gt;I kept all target features because I didn't want to join some separated tables based on a UID, but I'm starting to get the feeling that I'll have to do that anyways&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Does Spatial Join do this sometimes where it can overwrite the Allow Null Values flag from No to Yes?&lt;/P&gt;&lt;P&gt;Is there any way for me to prevent that?&lt;/P&gt;&lt;P&gt;Is the easier way to just join fields based on UID later?&lt;/P&gt;&lt;P&gt;What's a solution to this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Jun 2018 20:28:39 GMT</pubDate>
    <dc:creator>DevonBurton1</dc:creator>
    <dc:date>2018-06-26T20:28:39Z</dc:date>
    <item>
      <title>Spatial Join in ModelBuilder overwriting Allow NULL values?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/spatial-join-in-modelbuilder-overwriting-allow/m-p/777379#M1794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My problem is as follows:&lt;/P&gt;&lt;P&gt;I'm using model builder for all of this.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I set up a blank feature class&lt;/LI&gt;&lt;LI&gt;I add fields to this blank feature class with names based on strings in a list, with the option Allow NULL values : No. Type: double, and immediately set their default value to 0. No records yet, it's all fine.&lt;/LI&gt;&lt;LI&gt;I append a line to this blank feature class (which has type: polyline) with schema type as: NO_TEST. The output is still "No" for all relevant fields, and they have their default value of 0.&lt;/LI&gt;&lt;LI&gt;I convert this line into a&amp;nbsp;bunch of equally long line segments. Each field is still "No" for NULL values and the default of 0 is listed for each record. (Generate points along line -&amp;gt; split line at points, this is fine)&lt;/LI&gt;&lt;LI&gt;I run a spatial join&amp;nbsp;on the output of 4 and a&amp;nbsp;featureclass that exists here and there along my line, with a "Within distance: 100 meters". I make sure that the field mapping still has everything set to "No" for NULL values, BUT&lt;/LI&gt;&lt;LI&gt;The output fields are now all Allow NULL Values: "Yes"&lt;UL&gt;&lt;LI&gt;My goal was to use the field calculator to grab the sum of a field from the joined featureclass and add it to a running total field in the target featureclass, I intended to get around an issue I was having wherein the target features that lacked a spatially joined feature would get NULL added to it, I think, and remove the value, causing me to eventually get ONLY NULL values for all of my relevant fields.&lt;/LI&gt;&lt;LI&gt;I kept all target features because I didn't want to join some separated tables based on a UID, but I'm starting to get the feeling that I'll have to do that anyways&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Does Spatial Join do this sometimes where it can overwrite the Allow Null Values flag from No to Yes?&lt;/P&gt;&lt;P&gt;Is there any way for me to prevent that?&lt;/P&gt;&lt;P&gt;Is the easier way to just join fields based on UID later?&lt;/P&gt;&lt;P&gt;What's a solution to this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jun 2018 20:28:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/spatial-join-in-modelbuilder-overwriting-allow/m-p/777379#M1794</guid>
      <dc:creator>DevonBurton1</dc:creator>
      <dc:date>2018-06-26T20:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Join in ModelBuilder overwriting Allow NULL values?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/spatial-join-in-modelbuilder-overwriting-allow/m-p/777380#M1795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Amazing what a night's sleep will do:&lt;/P&gt;&lt;P&gt;Using field calculator and learning how to do pre-logic scripting, I added this and this seems to work perfectly.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;def myTest(dest,test,test1):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if test==None:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a = dest + 0&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return a&lt;BR /&gt; else:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; a = dest + test + test1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return a&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2018 13:24:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/spatial-join-in-modelbuilder-overwriting-allow/m-p/777380#M1795</guid>
      <dc:creator>DevonBurton1</dc:creator>
      <dc:date>2018-06-27T13:24:25Z</dc:date>
    </item>
  </channel>
</rss>

