<?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 ListFields for Feature Dataset from Geoprocessing Window Fails in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/listfields-for-feature-dataset-from-geoprocessing/m-p/1664116#M74878</link>
    <description>&lt;P&gt;I'm building a Python Toolbox, and am stuck pretty early on getting it to list the fields of a feature class that is part of a Feature Dataset.&lt;/P&gt;&lt;P class="lia-align-justify"&gt;I have a dataset at&amp;nbsp;&lt;FONT face="courier new,courier"&gt;C:/Users/my_user/Documents/scratch/test.gdb/data/my_fc&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The code for the toolbox is below (abridged from template).&lt;/P&gt;&lt;P&gt;I've loaded the dataset and toolbox into my Pro project, and I'm using the geoprocessing tool, adding the dataaset via the dropdown.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

class my_tool:
    def __init__(self):
        """Define the tool (tool name is the name of the class)."""
        self.label = "List Fields Demo"
        self.description = "Lists the fields in a feature class."

    def getParameterInfo(self):
        """Define the tool parameters."""
        param0 = arcpy.Parameter( # where the user will input a feature layer to convert
            displayName="Input Feature Class",
            name="in_features",
            datatype="GPFeatureLayer",
            parameterType="Required",
            direction="Input")
        return [param0]

# [Unmodified Python Toolbox template code omitted...]

    def execute(self, parameters, messages):
        """The source code of the tool."""
        desc = arcpy.Describe(parameters[0])
        src=desc.catalogPath
        arcpy.AddMessage(src)
        # 'C:/Users/my_user/Documents/scratch/test.gdb/test.gdb/data/my_fc'
        fields = arcpy.ListFields(src)
        arcpy.AddMessage(fields)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's a little odd that the AddMessage shows a doubled file geodatabase name.&amp;nbsp; Even when I did some additional manipulations to remove the doubling, it isn't able to open the input feature class to list fields.&lt;BR /&gt;&lt;BR /&gt;So, what's the reasonably-obvious thing that I'm missing here?&lt;/P&gt;</description>
    <pubDate>Thu, 06 Nov 2025 23:17:46 GMT</pubDate>
    <dc:creator>BillMitchell</dc:creator>
    <dc:date>2025-11-06T23:17:46Z</dc:date>
    <item>
      <title>ListFields for Feature Dataset from Geoprocessing Window Fails</title>
      <link>https://community.esri.com/t5/python-questions/listfields-for-feature-dataset-from-geoprocessing/m-p/1664116#M74878</link>
      <description>&lt;P&gt;I'm building a Python Toolbox, and am stuck pretty early on getting it to list the fields of a feature class that is part of a Feature Dataset.&lt;/P&gt;&lt;P class="lia-align-justify"&gt;I have a dataset at&amp;nbsp;&lt;FONT face="courier new,courier"&gt;C:/Users/my_user/Documents/scratch/test.gdb/data/my_fc&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The code for the toolbox is below (abridged from template).&lt;/P&gt;&lt;P&gt;I've loaded the dataset and toolbox into my Pro project, and I'm using the geoprocessing tool, adding the dataaset via the dropdown.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

class my_tool:
    def __init__(self):
        """Define the tool (tool name is the name of the class)."""
        self.label = "List Fields Demo"
        self.description = "Lists the fields in a feature class."

    def getParameterInfo(self):
        """Define the tool parameters."""
        param0 = arcpy.Parameter( # where the user will input a feature layer to convert
            displayName="Input Feature Class",
            name="in_features",
            datatype="GPFeatureLayer",
            parameterType="Required",
            direction="Input")
        return [param0]

# [Unmodified Python Toolbox template code omitted...]

    def execute(self, parameters, messages):
        """The source code of the tool."""
        desc = arcpy.Describe(parameters[0])
        src=desc.catalogPath
        arcpy.AddMessage(src)
        # 'C:/Users/my_user/Documents/scratch/test.gdb/test.gdb/data/my_fc'
        fields = arcpy.ListFields(src)
        arcpy.AddMessage(fields)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's a little odd that the AddMessage shows a doubled file geodatabase name.&amp;nbsp; Even when I did some additional manipulations to remove the doubling, it isn't able to open the input feature class to list fields.&lt;BR /&gt;&lt;BR /&gt;So, what's the reasonably-obvious thing that I'm missing here?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2025 23:17:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listfields-for-feature-dataset-from-geoprocessing/m-p/1664116#M74878</guid>
      <dc:creator>BillMitchell</dc:creator>
      <dc:date>2025-11-06T23:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: ListFields for Feature Dataset from Geoprocessing Window Fails</title>
      <link>https://community.esri.com/t5/python-questions/listfields-for-feature-dataset-from-geoprocessing/m-p/1664143#M74879</link>
      <description>&lt;P&gt;Is your FGDB inside of a folder named "test.gdb"?&amp;nbsp; I've had this happen when unzipping FGDBs before and it causes all kinds of headaches with different tools and ArcPy functions.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2025 02:07:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listfields-for-feature-dataset-from-geoprocessing/m-p/1664143#M74879</guid>
      <dc:creator>MobiusSnake</dc:creator>
      <dc:date>2025-11-07T02:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: ListFields for Feature Dataset from Geoprocessing Window Fails</title>
      <link>https://community.esri.com/t5/python-questions/listfields-for-feature-dataset-from-geoprocessing/m-p/1664147#M74880</link>
      <description>&lt;P&gt;I hate using the List* functions, they're always really finnickey.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can also grab fields by using a da.SearchCursor&lt;/P&gt;&lt;LI-CODE lang="python"&gt;with arcpy.da.SearchCursor(src, '*') as cur:
    fields = cur.fields&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 07 Nov 2025 14:28:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listfields-for-feature-dataset-from-geoprocessing/m-p/1664147#M74880</guid>
      <dc:creator>HaydenWelch</dc:creator>
      <dc:date>2025-11-07T14:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: ListFields for Feature Dataset from Geoprocessing Window Fails</title>
      <link>https://community.esri.com/t5/python-questions/listfields-for-feature-dataset-from-geoprocessing/m-p/1664195#M74881</link>
      <description>&lt;P&gt;I'm not sure how I missed this, but yes, that was the problem.&amp;nbsp; I'll add this to the list of reasons I'd rather work with Geopackages.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2025 14:58:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listfields-for-feature-dataset-from-geoprocessing/m-p/1664195#M74881</guid>
      <dc:creator>BillMitchell</dc:creator>
      <dc:date>2025-11-07T14:58:11Z</dc:date>
    </item>
  </channel>
</rss>

