<?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: Does anyone have a script that turns off fields that are empty? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/does-anyone-have-a-script-that-turns-off-fields/m-p/354694#M27902</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm assuming that you want to change the visibility of the fields within the attribute table. If you wanted to modify this value against an existing layer you'd probably need to utilize ArcObjects and the code would center around the following logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ILayerFields layerFields = (ILayerFields) layer;

for (int i = 0; i &amp;lt; layerFields.FieldCount; i++)
&amp;nbsp;&amp;nbsp;&amp;nbsp; layerFields.FieldInfo&lt;I&gt;.Visible = false;&lt;/I&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to create a new layer then you'd probably want to leverage a tool that would allow you to utilize a FieldInfo object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FieldInfo&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-classes/fieldinfo.htm" title="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-classes/fieldinfo.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-classes/fieldinfo.htm&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Make Feature Layer&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/make-feature-layer.htm" title="http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/make-feature-layer.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/make-feature-layer.htm&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Make Table View&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/make-table-view.htm" title="http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/make-table-view.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/make-table-view.htm&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 16:38:02 GMT</pubDate>
    <dc:creator>FreddieGibson</dc:creator>
    <dc:date>2021-12-11T16:38:02Z</dc:date>
    <item>
      <title>Does anyone have a script that turns off fields that are empty?</title>
      <link>https://community.esri.com/t5/python-questions/does-anyone-have-a-script-that-turns-off-fields/m-p/354692#M27900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to find python code samples that will review a feature class and identify all of the fields that are empty and turn their visibility off.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Dec 2015 17:14:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/does-anyone-have-a-script-that-turns-off-fields/m-p/354692#M27900</guid>
      <dc:creator>BobbySells</dc:creator>
      <dc:date>2015-12-10T17:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Does anyone have a script that turns off fields that are empty?</title>
      <link>https://community.esri.com/t5/python-questions/does-anyone-have-a-script-that-turns-off-fields/m-p/354693#M27901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bobby,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest moving this to &lt;A href="https://community.esri.com/space/2145"&gt;Python&lt;/A&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Dec 2015 17:20:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/does-anyone-have-a-script-that-turns-off-fields/m-p/354693#M27901</guid>
      <dc:creator>RickeyFight</dc:creator>
      <dc:date>2015-12-10T17:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Does anyone have a script that turns off fields that are empty?</title>
      <link>https://community.esri.com/t5/python-questions/does-anyone-have-a-script-that-turns-off-fields/m-p/354694#M27902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm assuming that you want to change the visibility of the fields within the attribute table. If you wanted to modify this value against an existing layer you'd probably need to utilize ArcObjects and the code would center around the following logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ILayerFields layerFields = (ILayerFields) layer;

for (int i = 0; i &amp;lt; layerFields.FieldCount; i++)
&amp;nbsp;&amp;nbsp;&amp;nbsp; layerFields.FieldInfo&lt;I&gt;.Visible = false;&lt;/I&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to create a new layer then you'd probably want to leverage a tool that would allow you to utilize a FieldInfo object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FieldInfo&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-classes/fieldinfo.htm" title="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-classes/fieldinfo.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-classes/fieldinfo.htm&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Make Feature Layer&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/make-feature-layer.htm" title="http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/make-feature-layer.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/make-feature-layer.htm&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Make Table View&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/make-table-view.htm" title="http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/make-table-view.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/make-table-view.htm&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:38:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/does-anyone-have-a-script-that-turns-off-fields/m-p/354694#M27902</guid>
      <dc:creator>FreddieGibson</dc:creator>
      <dc:date>2021-12-11T16:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Does anyone have a script that turns off fields that are empty?</title>
      <link>https://community.esri.com/t5/python-questions/does-anyone-have-a-script-that-turns-off-fields/m-p/354695#M27903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you tell us what you mean by having your fields empty?&amp;nbsp; Does this mean for all records the value is NULL? or something else?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 16:49:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/does-anyone-have-a-script-that-turns-off-fields/m-p/354695#M27903</guid>
      <dc:creator>DarrylKlassen</dc:creator>
      <dc:date>2015-12-11T16:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Does anyone have a script that turns off fields that are empty?</title>
      <link>https://community.esri.com/t5/python-questions/does-anyone-have-a-script-that-turns-off-fields/m-p/354696#M27904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes.&amp;nbsp; I have a whole gdb schema that users load data into.&amp;nbsp; if they don't have any data load into a particular field they just leave it blank, but some of the features have 40 fields and 10 will be empty.&amp;nbsp; it doesn't show well in web apps when in the attribute table or popup there are all of these fields with no values in them.&amp;nbsp; thank you everyone that is helping.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 19:59:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/does-anyone-have-a-script-that-turns-off-fields/m-p/354696#M27904</guid>
      <dc:creator>BobbySells</dc:creator>
      <dc:date>2015-12-11T19:59:33Z</dc:date>
    </item>
  </channel>
</rss>

