<?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 Re: How to evaluate NULL values in Field Script in ArcGIS Network Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-network-analyst-questions/how-to-evaluate-null-values-in-field-script/m-p/1149945#M7810</link>
    <description>&lt;P&gt;You are correct that the function to check for Null values is the IsNull() function.&amp;nbsp; However, VBScript doesn't like comparing a Null value to a string (which is what you're doing in the first half of your OR statement if that field value happens to be Null).&amp;nbsp; To get around this, you will need to make a Code Block that does the Null check separately, and only if the field value is not Null, then move forward to do the string comparison:&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;r&lt;/LI-CODE&gt;&lt;P&gt;Code Block:&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;r = False
If IsNull([RAV3_NETWORK]) Then
  r = True
ElseIf [RAV3_NETWORK] &amp;lt;&amp;gt; "Tandem Drive Network 3" Then
  r = True
End If&lt;/LI-CODE&gt;&lt;P&gt;For the unequality check, I used the &amp;lt;&amp;gt; operator instead of using Not with the = operator, since I don't like how VBScript overloads the = operator for both comparison and assignment.&lt;/P&gt;&lt;P&gt;Let me know if you're still running into problems.&amp;nbsp; Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alan&lt;/P&gt;</description>
    <pubDate>Wed, 02 Mar 2022 22:05:44 GMT</pubDate>
    <dc:creator>AlanHatakeyama</dc:creator>
    <dc:date>2022-03-02T22:05:44Z</dc:date>
    <item>
      <title>How to evaluate NULL values in Field Script</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/how-to-evaluate-null-values-in-field-script/m-p/1149465#M7804</link>
      <description>&lt;P&gt;I'm trying to write a Field Script in my Network Dataset Properties that limits a Travel Modes ability to use edges that don't contain specific attributes. For example, a feature with a column called RAV3_NETWORK either contains a value "Tandem Drive Network 3" or is NULL. I want to prohibit a route from traversing edges where that field is NULL.&lt;/P&gt;&lt;P&gt;I have managed to get this Field Script to work:&amp;nbsp;NOT([RAV3_NETWORK] = "Tandem Drive Network 3") where I have added in another random value instead of NULL, but I don't want to have to modify the data to do that.&lt;/P&gt;&lt;P&gt;I would rather use something like:&lt;/P&gt;&lt;P&gt;NOT([RAV3_NETWORK] = "Tandem Drive Network 3") OR [RAV3_NETWORK] IS NULL&lt;/P&gt;&lt;P&gt;which would find any value that isn't Tandem Drive Network 3 as well as return the Nulls - but I can't for the life of me get it to recognise Nulls. I've tried Empty, IsEmpty, IsNull as well with no luck. The above query returns this error in the Build Network log for each feature with a NULL value:&amp;nbsp;&lt;/P&gt;&lt;P&gt;SourceName: State_Road_Network, ObjectID: 354, Network object evaluator error.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LindsayRaabe_FPCWA_2-1646205622577.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35331iB3FE0B3924C0FD44/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LindsayRaabe_FPCWA_2-1646205622577.png" alt="LindsayRaabe_FPCWA_2-1646205622577.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LindsayRaabe_FPCWA_3-1646205693940.png" style="width: 584px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35332i52E4845D7EA5FF2E/image-dimensions/584x178?v=v2" width="584" height="178" role="button" title="LindsayRaabe_FPCWA_3-1646205693940.png" alt="LindsayRaabe_FPCWA_3-1646205693940.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 07:26:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/how-to-evaluate-null-values-in-field-script/m-p/1149465#M7804</guid>
      <dc:creator>LindsayRaabe_FPCWA</dc:creator>
      <dc:date>2022-03-02T07:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to evaluate NULL values in Field Script</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/how-to-evaluate-null-values-in-field-script/m-p/1149945#M7810</link>
      <description>&lt;P&gt;You are correct that the function to check for Null values is the IsNull() function.&amp;nbsp; However, VBScript doesn't like comparing a Null value to a string (which is what you're doing in the first half of your OR statement if that field value happens to be Null).&amp;nbsp; To get around this, you will need to make a Code Block that does the Null check separately, and only if the field value is not Null, then move forward to do the string comparison:&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;r&lt;/LI-CODE&gt;&lt;P&gt;Code Block:&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;r = False
If IsNull([RAV3_NETWORK]) Then
  r = True
ElseIf [RAV3_NETWORK] &amp;lt;&amp;gt; "Tandem Drive Network 3" Then
  r = True
End If&lt;/LI-CODE&gt;&lt;P&gt;For the unequality check, I used the &amp;lt;&amp;gt; operator instead of using Not with the = operator, since I don't like how VBScript overloads the = operator for both comparison and assignment.&lt;/P&gt;&lt;P&gt;Let me know if you're still running into problems.&amp;nbsp; Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alan&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 22:05:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/how-to-evaluate-null-values-in-field-script/m-p/1149945#M7810</guid>
      <dc:creator>AlanHatakeyama</dc:creator>
      <dc:date>2022-03-02T22:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to evaluate NULL values in Field Script</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/how-to-evaluate-null-values-in-field-script/m-p/1150004#M7811</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/135756"&gt;@AlanHatakeyama&lt;/a&gt;&amp;nbsp;That worked a charm. Thank you for your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 00:24:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/how-to-evaluate-null-values-in-field-script/m-p/1150004#M7811</guid>
      <dc:creator>LindsayRaabe_FPCWA</dc:creator>
      <dc:date>2022-03-03T00:24:29Z</dc:date>
    </item>
  </channel>
</rss>

