<?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 Changing NULL values with model builder in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/changing-null-values-with-model-builder/m-p/189062#M6458</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using model builder to build a tool, where at a certain point, I need to take the Z elevation values from the feature class that are NULL and turn them into the value 0 (zero). To do so, I'm using the calculate field tool. I just have a problem... I know very little of VB and NOTHING of python... I was hoping someone could help me create the appropriate code to change the values I need?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm guessing it should be something very simple... like an if..then statement? Something like: if Z=Null then Z=0. I just need to "translate" it into programming language.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help... please?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/images/icons/icon7.png" rel="nofollow" target="_blank"&gt;http://forums.arcgis.com/images/icons/icon7.png&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 May 2013 09:58:35 GMT</pubDate>
    <dc:creator>TanyaEsteves</dc:creator>
    <dc:date>2013-05-22T09:58:35Z</dc:date>
    <item>
      <title>Changing NULL values with model builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/changing-null-values-with-model-builder/m-p/189062#M6458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using model builder to build a tool, where at a certain point, I need to take the Z elevation values from the feature class that are NULL and turn them into the value 0 (zero). To do so, I'm using the calculate field tool. I just have a problem... I know very little of VB and NOTHING of python... I was hoping someone could help me create the appropriate code to change the values I need?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm guessing it should be something very simple... like an if..then statement? Something like: if Z=Null then Z=0. I just need to "translate" it into programming language.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help... please?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/images/icons/icon7.png" rel="nofollow" target="_blank"&gt;http://forums.arcgis.com/images/icons/icon7.png&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 09:58:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/changing-null-values-with-model-builder/m-p/189062#M6458</guid>
      <dc:creator>TanyaEsteves</dc:creator>
      <dc:date>2013-05-22T09:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Changing NULL values with model builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/changing-null-values-with-model-builder/m-p/189063#M6459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The correct syntax for the NULL keyword is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Z" IS NULL&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;do not use the "=" with NULL.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jim&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 12:52:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/changing-null-values-with-model-builder/m-p/189063#M6459</guid>
      <dc:creator>JimCousins</dc:creator>
      <dc:date>2013-05-22T12:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Changing NULL values with model builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/changing-null-values-with-model-builder/m-p/189064#M6460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well, so far I got:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim Z&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If IsNull (&lt;Z&gt;) = "True" then&lt;/Z&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;Z&gt; = 0 &lt;/Z&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End if&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But it doesn't work... any suggestions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 13:13:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/changing-null-values-with-model-builder/m-p/189064#M6460</guid>
      <dc:creator>TanyaEsteves</dc:creator>
      <dc:date>2013-05-22T13:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Changing NULL values with model builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/changing-null-values-with-model-builder/m-p/189065#M6461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Well, so far I got:&lt;BR /&gt;&lt;BR /&gt;Dim Z&lt;BR /&gt;If IsNull (&lt;Z&gt;) = "True" then&lt;BR /&gt;&lt;Z&gt; = 0 &lt;BR /&gt;End if&lt;BR /&gt;&lt;BR /&gt;But it doesn't work... any suggestions?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/Z&gt;&lt;/Z&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;To do this you need to check the codeblock checkbox.&amp;nbsp; You also have to handle the situation where the Z field has a value and is not Null.&amp;nbsp; Finally you cannot use a field name as the output of the calculation only a variable which is only resolved to a specific field by doing the calculation on a given field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Parser:&amp;nbsp; VBScript&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Prelogic codeblock:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;If IsNull(&lt;Z&gt;) Then &amp;nbsp; Output = 0 Else &amp;nbsp; Output = &lt;Z&gt; End If&lt;/Z&gt;&lt;/Z&gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Expression:&amp;nbsp; Output&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 13:21:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/changing-null-values-with-model-builder/m-p/189065#M6461</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2013-05-22T13:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Changing NULL values with model builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/changing-null-values-with-model-builder/m-p/189066#M6462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear rfairhur24,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you so much for your help. It worked perfectly!! I really need to get my head around programming!! &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/images/icons/icon11.png"&gt;http://forums.arcgis.com/images/icons/icon11.png&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best wishes.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 14:22:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/changing-null-values-with-model-builder/m-p/189066#M6462</guid>
      <dc:creator>TanyaEsteves</dc:creator>
      <dc:date>2013-05-22T14:22:39Z</dc:date>
    </item>
  </channel>
</rss>

