<?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 'None' returned from .layers with API in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/none-returned-from-layers-with-api/m-p/1024131#M5508</link>
    <description>&lt;P&gt;I've done this successfully on a dozen different scripts with other feature layers however this one is causing me issues. After logging into portal with the Python API, I get the item I am working with.&lt;/P&gt;&lt;P&gt;port_item = gis.content.get('#############')&lt;/P&gt;&lt;P&gt;That returns the appropriate item. Then I will grab the point layer.&lt;/P&gt;&lt;P&gt;item_layers = port_item.layers&lt;/P&gt;&lt;P&gt;That, however, returns 'None'.&lt;/P&gt;&lt;P&gt;I've compared with other feature layers that it has worked fine on and I can't find any differences that would cause it to fail. Everything is a hosted feature service, everything is either points or polygons, and just switching out the itemID will successfully return other layers so I know there's not a typo or portal issue.&lt;/P&gt;</description>
    <pubDate>Sat, 06 Feb 2021 15:28:45 GMT</pubDate>
    <dc:creator>JasonJordan00</dc:creator>
    <dc:date>2021-02-06T15:28:45Z</dc:date>
    <item>
      <title>'None' returned from .layers with API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/none-returned-from-layers-with-api/m-p/1024131#M5508</link>
      <description>&lt;P&gt;I've done this successfully on a dozen different scripts with other feature layers however this one is causing me issues. After logging into portal with the Python API, I get the item I am working with.&lt;/P&gt;&lt;P&gt;port_item = gis.content.get('#############')&lt;/P&gt;&lt;P&gt;That returns the appropriate item. Then I will grab the point layer.&lt;/P&gt;&lt;P&gt;item_layers = port_item.layers&lt;/P&gt;&lt;P&gt;That, however, returns 'None'.&lt;/P&gt;&lt;P&gt;I've compared with other feature layers that it has worked fine on and I can't find any differences that would cause it to fail. Everything is a hosted feature service, everything is either points or polygons, and just switching out the itemID will successfully return other layers so I know there's not a typo or portal issue.&lt;/P&gt;</description>
      <pubDate>Sat, 06 Feb 2021 15:28:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/none-returned-from-layers-with-api/m-p/1024131#M5508</guid>
      <dc:creator>JasonJordan00</dc:creator>
      <dc:date>2021-02-06T15:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: 'None' returned from .layers with API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/none-returned-from-layers-with-api/m-p/1024159#M5512</link>
      <description>&lt;P&gt;I don't suppose the layer in question is public so that others could attempt to replicate the issue? The only time I've been able to get &lt;STRONG&gt;layers&lt;/STRONG&gt; to return 'None' is when the service in question is a hosted table with no features, but as you say, that does not apply to your particular item.&lt;/P&gt;&lt;P&gt;Sight unseen, I would have to assume that there is &lt;EM&gt;something&lt;/EM&gt; different about the item itself. Are you able to access other classes, like &lt;STRONG&gt;manager&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;Alternately, if you instantiate the service using arcgis.features.FeatureLayerCollection and the service URL as opposed to the item ID, does the issue persist?&lt;/P&gt;</description>
      <pubDate>Sat, 06 Feb 2021 19:18:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/none-returned-from-layers-with-api/m-p/1024159#M5512</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-02-06T19:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: 'None' returned from .layers with API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/none-returned-from-layers-with-api/m-p/1025002#M5532</link>
      <description>&lt;P&gt;Using the FeatureLayerCollection method got it to return a token error message that pointed me to a step that slipped my mind. Our portal is behind a firewall so nothing is able to go public, but I forgot to share the layer publicly anyway so it doesn't look for a token (which our authorization methods doesn't easily generate through Python). That's what I've had to do for all other feature services I've used the API on, just plumb forgot to do it this time.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 19:49:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/none-returned-from-layers-with-api/m-p/1025002#M5532</guid>
      <dc:creator>JasonJordan00</dc:creator>
      <dc:date>2021-02-09T19:49:47Z</dc:date>
    </item>
  </channel>
</rss>

