<?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: Error in Empty Field Length in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/error-in-empty-field-length/m-p/1364931#M69509</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/750548"&gt;@chagade6&lt;/a&gt;&amp;nbsp; Thank you for the suggestion, but I'm not getting your answer, like how can I get empty Field Length based on order of Field!?&amp;nbsp;&lt;BR /&gt;Using ArcPy Module I'm getting the Length of Field using&amp;nbsp;&lt;SPAN&gt;ListFields() Method,&amp;nbsp;as you can see in screenshot Field Length is Empty but I'm not getting empty length, For Short getting 2 as Field Length and for Double getting 4 as Field Length instead&amp;nbsp;of this,&amp;nbsp;I&amp;nbsp;want Empty Fields to Validate!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krishna_94_1-1703839913088.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/90116iA252B6645E24465B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Krishna_94_1-1703839913088.png" alt="Krishna_94_1-1703839913088.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Dec 2023 08:52:00 GMT</pubDate>
    <dc:creator>Krishna_94</dc:creator>
    <dc:date>2023-12-29T08:52:00Z</dc:date>
    <item>
      <title>Error in Empty Field Length</title>
      <link>https://community.esri.com/t5/python-questions/error-in-empty-field-length/m-p/1364705#M69492</link>
      <description>&lt;P&gt;In ArcGIS Pro I have a feature class called&amp;nbsp;SWNDMNHL which has the list of fields, in which some fields have empty length, but when I'm fetching this fields from Python arcpy library it gives me a random field length instead of empty field length. How should i validate the field length?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krishna_94_0-1703762346253.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/90066iD54B8049933D0A34/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Krishna_94_0-1703762346253.png" alt="Krishna_94_0-1703762346253.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;for fld in arcpy.ListFields('SWNDMNHL'):
   print(f'Field : {str(fld.name)} and Length : {str(fld.length)} ')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It gives me below output:&lt;BR /&gt;Field : COVER_LVL and Length : 8, Field : COV_SLB_LVL and Length : 8, Field : COV_THKNS and Length : 2&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;Thank you!!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2023 11:25:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-in-empty-field-length/m-p/1364705#M69492</guid>
      <dc:creator>Krishna_94</dc:creator>
      <dc:date>2023-12-28T11:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Empty Field Length</title>
      <link>https://community.esri.com/t5/python-questions/error-in-empty-field-length/m-p/1364710#M69493</link>
      <description>&lt;P&gt;It depends a little bit. Is there any field that is filled in every note? If so, the easiest thing to do is change your order of fields &amp;amp; make that field #1&amp;nbsp;&lt;A href="https://routerlogin.uno/" target="_self"&gt;&lt;SPAN&gt;https://routerlogin.uno/&lt;/SPAN&gt;&lt;/A&gt; .&lt;/P&gt;</description>
      <pubDate>Sat, 30 Dec 2023 11:00:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-in-empty-field-length/m-p/1364710#M69493</guid>
      <dc:creator>chagade6</dc:creator>
      <dc:date>2023-12-30T11:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Empty Field Length</title>
      <link>https://community.esri.com/t5/python-questions/error-in-empty-field-length/m-p/1364737#M69500</link>
      <description>&lt;P&gt;The two lengths you are looking at are not measuring the same "length."&amp;nbsp; Although Esri doesn't clearly state it, the behavior you are seeing can be explained by the Fields view in the ArcGIS Pro GUI displaying &lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic40870.html" target="_blank"&gt;FieldDescription Class—ArcGIS Pro&lt;/A&gt; length while the ArcPy Field object is giving you&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic7066.html" target="_blank"&gt;Field Class—ArcGIS Pro&lt;/A&gt; length.&amp;nbsp; The FieldDescription Class length only applies to String and OID fields, so it shows nothing/empty for numeric data types, while the Field Class length applies to all fields.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2023 15:23:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-in-empty-field-length/m-p/1364737#M69500</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2023-12-28T15:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Empty Field Length</title>
      <link>https://community.esri.com/t5/python-questions/error-in-empty-field-length/m-p/1364929#M69508</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1371"&gt;@JoshuaBixby&lt;/a&gt;&amp;nbsp; Thank you for the suggestion, I still don't get the solution can you suggest me how to access Field Description Class using ArcPy Module? I have been searching for the method for ArcPy module and I can find only&amp;nbsp;ListFields() Method to get Field Length.&lt;BR /&gt;I want the Fields which doesn't have length but with&amp;nbsp;ListFields() I'm getting default value like for instance if the Field type is Short then it will return Field Length 2 but as you can see in provided Screenshot, I do not assign any Field Length to that attribute.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krishna_94_0-1703839529418.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/90115iACEAABFC49B5A780/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Krishna_94_0-1703839529418.png" alt="Krishna_94_0-1703839529418.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2023 08:45:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-in-empty-field-length/m-p/1364929#M69508</guid>
      <dc:creator>Krishna_94</dc:creator>
      <dc:date>2023-12-29T08:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Empty Field Length</title>
      <link>https://community.esri.com/t5/python-questions/error-in-empty-field-length/m-p/1364931#M69509</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/750548"&gt;@chagade6&lt;/a&gt;&amp;nbsp; Thank you for the suggestion, but I'm not getting your answer, like how can I get empty Field Length based on order of Field!?&amp;nbsp;&lt;BR /&gt;Using ArcPy Module I'm getting the Length of Field using&amp;nbsp;&lt;SPAN&gt;ListFields() Method,&amp;nbsp;as you can see in screenshot Field Length is Empty but I'm not getting empty length, For Short getting 2 as Field Length and for Double getting 4 as Field Length instead&amp;nbsp;of this,&amp;nbsp;I&amp;nbsp;want Empty Fields to Validate!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krishna_94_1-1703839913088.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/90116iA252B6645E24465B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Krishna_94_1-1703839913088.png" alt="Krishna_94_1-1703839913088.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2023 08:52:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-in-empty-field-length/m-p/1364931#M69509</guid>
      <dc:creator>Krishna_94</dc:creator>
      <dc:date>2023-12-29T08:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Empty Field Length</title>
      <link>https://community.esri.com/t5/python-questions/error-in-empty-field-length/m-p/1365203#M69518</link>
      <description>&lt;P&gt;I don't believe the fieldDescription class is exposed through ArcPy, or at least the Length property you are looking for under fieldDescription.&amp;nbsp; That said, you don't need it to be since you can simply check the field type and return an empty string if it is anything but Text.&amp;nbsp; Something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;for fld in arcpy.ListFields('SWNDMNHL'):
   print(f'Field : {fld.name} and Length : {fld.length if fld.type == "String" else ""} ')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Dec 2023 23:19:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-in-empty-field-length/m-p/1365203#M69518</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2023-12-31T23:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Empty Field Length</title>
      <link>https://community.esri.com/t5/python-questions/error-in-empty-field-length/m-p/1365296#M69519</link>
      <description>&lt;P&gt;Thank you for the suggestion &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1371"&gt;@JoshuaBixby&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2024 12:50:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-in-empty-field-length/m-p/1365296#M69519</guid>
      <dc:creator>Krishna_94</dc:creator>
      <dc:date>2024-01-02T12:50:15Z</dc:date>
    </item>
  </channel>
</rss>

