<?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: What is the point of Non-Nullable Fields? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/what-is-the-point-of-non-nullable-fields/m-p/1390818#M79763</link>
    <description>&lt;P&gt;In my experience, Pro&amp;nbsp;&lt;EM&gt;does&lt;/EM&gt; throw an error if you're editing an existing feature and try to &lt;STRONG&gt;NULL&lt;/STRONG&gt; a non-nullable field.&amp;nbsp; If you're creating a new feature, it fills in the default value.&amp;nbsp; If you didn't specify a default value in your schema, then it uses one of the&amp;nbsp;&lt;EM&gt;default&lt;/EM&gt; defaults that you mentioned above.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;As for why you might want to use NULL vs a Default/Sentinel Value:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Let's consider implementing a material field on a Storm Pipe feature in my organization, in two different approaches.&amp;nbsp; The Default Value is what is there for a newly-created feature whose material hasn't been determined, yet.&amp;nbsp; The Filled Test Value is what is there for a different feature whose material has been determined.&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;Approach A&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;Approach B&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;NULL Prohibited&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;Default Value: "Unknown"&lt;/LI&gt;&lt;LI&gt;Filled Test Value: "Concrete"&lt;/LI&gt;&lt;/UL&gt;&lt;/TD&gt;&lt;TD&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;NULL Permitted&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;Default Value: &lt;STRONG&gt;NULL&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;Filled Test Value: "Concrete"&lt;/LI&gt;&lt;/UL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, let's assume I want to run some python code on this field.&amp;nbsp; Maybe I only want to keep the first three letters, now, and capitalize them:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;!materialfield![:3].upper()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above code—if entered in the Field Calculator in Python mode—should take the first three characters, capitalize them all, and throw away everything else.&lt;/P&gt;&lt;P&gt;Let's first look at that filled test value:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;STRONG&gt;Approach A&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;STRONG&gt;Approach B&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Original Value&lt;/TD&gt;&lt;TD&gt;"Concrete"&lt;/TD&gt;&lt;TD&gt;"Concrete"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;Expected Results&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;"CON"&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;"CON"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;Actual Results&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;"CON"&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;"CON"&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, so good.&amp;nbsp; But the way we ran that code, it's also going to run on the features with that default value.&amp;nbsp; Let's see how those look:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;STRONG&gt;Approach A&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;STRONG&gt;Approach B&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Original Value&lt;/TD&gt;&lt;TD&gt;"Unknown"&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;NULL&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;Expected Results&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;"UNK"&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;STRONG&gt;NULL&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;Actual Results&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;"UNK"&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;A Python TypeError stops your code in its tracks&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sure there are plenty of other similar examples.&amp;nbsp; But at its root, you'd enforce &lt;STRONG&gt;NULL&lt;/STRONG&gt; if you wanted to ensure that the data type for that column is always the same, whether the cell is populated or not.&amp;nbsp; Because in both SQL and Python (and I think Arcade?) &lt;STRONG&gt;NULL&lt;/STRONG&gt; is technically a different data type and will break some functions.&lt;/P&gt;</description>
    <pubDate>Mon, 04 Mar 2024 23:22:58 GMT</pubDate>
    <dc:creator>MErikReedAugusta</dc:creator>
    <dc:date>2024-03-04T23:22:58Z</dc:date>
    <item>
      <title>What is the point of Non-Nullable Fields?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/what-is-the-point-of-non-nullable-fields/m-p/1390658#M79744</link>
      <description>&lt;P&gt;I am curious if/when other users are implementing "non-nullable" fields in their feature class/table design? If so, why? What does it achieve/what are you trying to achieve?&amp;nbsp;I ask because I don't understand the utility of this setting.&lt;/P&gt;&lt;P&gt;If I have a TEXT field that is "non-nullable", ArcGIS Pro will just throw in an empty string (maybe a space " ", my point is the same) as I am digitizing features. If I have a non-nullable numeric field, ArcGIS Pro will populate it with a "0". Date field, 12/31/1899. So, while the field is technically "non-nullable", this doesn't really help me from a data-integrity standpoint. If Pro would throw an error during editing that would prevent saving a record (similar to an Attribute Rule that fails, or a correct domain value not being chosen), I would understand the purpose. But it doesn't throw an error--it just fills in a generic value. The worst offenders are numeric fields, where Pro will populate a "0", which to me, is much harder to detect as an issue than simply allowing a &amp;lt;NULL&amp;gt; in that field, indicating the record should be reviewed. At least 12/31/1899 stands out as being a weird value that might require further review.&lt;/P&gt;&lt;P&gt;Is the point simply to prevent NULL values because... they are not acceptable in a particular database for some reason (why not? why is "" and "0" filler data better?)? Does the nullability setting result in a different experience for FieldMaps users, where it actually makes more sense?&lt;/P&gt;&lt;P&gt;For whatever it's worth, I am speaking mostly of File Geodatabases here, but do work regularly in Enterprise Geodatabases (SQL Server). If the behavior is different or makes more sense in an EGDB, I would be happy to hear about that too.&lt;/P&gt;&lt;P&gt;Thanks, genuinely curious how folks are using the "nullability" setting.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 19:37:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/what-is-the-point-of-non-nullable-fields/m-p/1390658#M79744</guid>
      <dc:creator>VinceE</dc:creator>
      <dc:date>2024-03-04T19:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: What is the point of Non-Nullable Fields?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/what-is-the-point-of-non-nullable-fields/m-p/1390818#M79763</link>
      <description>&lt;P&gt;In my experience, Pro&amp;nbsp;&lt;EM&gt;does&lt;/EM&gt; throw an error if you're editing an existing feature and try to &lt;STRONG&gt;NULL&lt;/STRONG&gt; a non-nullable field.&amp;nbsp; If you're creating a new feature, it fills in the default value.&amp;nbsp; If you didn't specify a default value in your schema, then it uses one of the&amp;nbsp;&lt;EM&gt;default&lt;/EM&gt; defaults that you mentioned above.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;As for why you might want to use NULL vs a Default/Sentinel Value:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Let's consider implementing a material field on a Storm Pipe feature in my organization, in two different approaches.&amp;nbsp; The Default Value is what is there for a newly-created feature whose material hasn't been determined, yet.&amp;nbsp; The Filled Test Value is what is there for a different feature whose material has been determined.&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;Approach A&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;Approach B&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;NULL Prohibited&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;Default Value: "Unknown"&lt;/LI&gt;&lt;LI&gt;Filled Test Value: "Concrete"&lt;/LI&gt;&lt;/UL&gt;&lt;/TD&gt;&lt;TD&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;NULL Permitted&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;Default Value: &lt;STRONG&gt;NULL&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;Filled Test Value: "Concrete"&lt;/LI&gt;&lt;/UL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, let's assume I want to run some python code on this field.&amp;nbsp; Maybe I only want to keep the first three letters, now, and capitalize them:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;!materialfield![:3].upper()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above code—if entered in the Field Calculator in Python mode—should take the first three characters, capitalize them all, and throw away everything else.&lt;/P&gt;&lt;P&gt;Let's first look at that filled test value:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;STRONG&gt;Approach A&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;STRONG&gt;Approach B&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Original Value&lt;/TD&gt;&lt;TD&gt;"Concrete"&lt;/TD&gt;&lt;TD&gt;"Concrete"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;Expected Results&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;"CON"&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;"CON"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;Actual Results&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;"CON"&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;"CON"&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, so good.&amp;nbsp; But the way we ran that code, it's also going to run on the features with that default value.&amp;nbsp; Let's see how those look:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;STRONG&gt;Approach A&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;STRONG&gt;Approach B&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Original Value&lt;/TD&gt;&lt;TD&gt;"Unknown"&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;NULL&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;Expected Results&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;"UNK"&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;STRONG&gt;NULL&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;Actual Results&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;"UNK"&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;A Python TypeError stops your code in its tracks&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sure there are plenty of other similar examples.&amp;nbsp; But at its root, you'd enforce &lt;STRONG&gt;NULL&lt;/STRONG&gt; if you wanted to ensure that the data type for that column is always the same, whether the cell is populated or not.&amp;nbsp; Because in both SQL and Python (and I think Arcade?) &lt;STRONG&gt;NULL&lt;/STRONG&gt; is technically a different data type and will break some functions.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 23:22:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/what-is-the-point-of-non-nullable-fields/m-p/1390818#M79763</guid>
      <dc:creator>MErikReedAugusta</dc:creator>
      <dc:date>2024-03-04T23:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: What is the point of Non-Nullable Fields?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/what-is-the-point-of-non-nullable-fields/m-p/1390824#M79764</link>
      <description>&lt;P&gt;One more thing I'll add:&lt;BR /&gt;In our organization, we inherited a bunch of legacy data that was full of NULL values.&amp;nbsp; We wanted to fix this going forward, so we thought we'd try making the fields for incoming data non-nullable.&lt;/P&gt;&lt;P&gt;In practice, this just caused headaches for legitimate cases where data either wasn't available or wasn't logically possible, and we ended up having to walk that decision back for a few things.&amp;nbsp; NULL has its valid uses.&lt;/P&gt;&lt;P&gt;I&amp;nbsp;&lt;STRONG&gt;don't&lt;/STRONG&gt; recommend trying to use non-nullable to make sure people are always supplying the relevant data.&amp;nbsp; Domains &amp;amp; QAQC procedures are better for that.&lt;/P&gt;&lt;P&gt;I&amp;nbsp;&lt;STRONG&gt;do&lt;/STRONG&gt; recommend using it to ensure datatype consistency for back-end things like the the example I posted above.&lt;/P&gt;&lt;P&gt;I&amp;nbsp;&lt;STRONG&gt;do&amp;nbsp;&lt;/STRONG&gt;recommend being mindful of those cases where NULL has a valid use-case, because you'll run into the pitfalls in my above post, and you'll need to write longer automation or more complex SQL queries to account for your otherwise-valid NULLs.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 23:28:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/what-is-the-point-of-non-nullable-fields/m-p/1390824#M79764</guid>
      <dc:creator>MErikReedAugusta</dc:creator>
      <dc:date>2024-03-04T23:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: What is the point of Non-Nullable Fields?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/what-is-the-point-of-non-nullable-fields/m-p/1390829#M79765</link>
      <description>&lt;P&gt;Your point about data types (String vs. NoneType) is an interesting one I hadn't considered, thanks for that.&lt;/P&gt;&lt;P&gt;I can't replicate Pro (3.X) throwing an error regarding "nulling" a non-nullable field though, unless you're talking about using Field Calculator to "&amp;lt;Null&amp;gt;" a field, in which case it does yield an error.&lt;/P&gt;&lt;P&gt;Thanks again for the detailed response.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 23:39:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/what-is-the-point-of-non-nullable-fields/m-p/1390829#M79765</guid>
      <dc:creator>VinceE</dc:creator>
      <dc:date>2024-03-04T23:39:10Z</dc:date>
    </item>
  </channel>
</rss>

