<?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 Filter View Layers in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-view-layers/m-p/1348623#M9278</link>
    <description>&lt;P&gt;I am trying to find my AGOL hosted feature layers that are not view layers. In my code I first identify how many items are in a content folder, then I filter out only feature services. This will include both parent layers and their view layers. I can't figure out how to just get the parent layers. I thought there was a property for "has views" but I haven't been able to figure out how to use that either. Is it possible to find just the parent hosted feature layers from my content or just the view layers?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Get the user's folder
user = gis.users.me
folder_name = "Data"

# Get list of items from the folder
items = user.items(folder=folder_name)
print(f"Found {len(items)} items in the folder '{folder_name}'.")

# Filter to get only feature services
FeatureServices = [item for item in items if item.type == "Feature Service"]
print(f"Found {len(FeatureServices)} feature services in the folder '{folder_name}'.")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Nov 2023 13:07:32 GMT</pubDate>
    <dc:creator>gargarcia</dc:creator>
    <dc:date>2023-11-13T13:07:32Z</dc:date>
    <item>
      <title>Filter View Layers</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-view-layers/m-p/1348623#M9278</link>
      <description>&lt;P&gt;I am trying to find my AGOL hosted feature layers that are not view layers. In my code I first identify how many items are in a content folder, then I filter out only feature services. This will include both parent layers and their view layers. I can't figure out how to just get the parent layers. I thought there was a property for "has views" but I haven't been able to figure out how to use that either. Is it possible to find just the parent hosted feature layers from my content or just the view layers?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Get the user's folder
user = gis.users.me
folder_name = "Data"

# Get list of items from the folder
items = user.items(folder=folder_name)
print(f"Found {len(items)} items in the folder '{folder_name}'.")

# Filter to get only feature services
FeatureServices = [item for item in items if item.type == "Feature Service"]
print(f"Found {len(FeatureServices)} feature services in the folder '{folder_name}'.")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2023 13:07:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-view-layers/m-p/1348623#M9278</guid>
      <dc:creator>gargarcia</dc:creator>
      <dc:date>2023-11-13T13:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Filter View Layers</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-view-layers/m-p/1348656#M9279</link>
      <description>&lt;P&gt;You'll want to convert your feature service item to a FeatureLayerCollection, from there you can get the properties and check "hasViews" or "isView".&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2023 14:30:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-view-layers/m-p/1348656#M9279</guid>
      <dc:creator>MobiusSnake</dc:creator>
      <dc:date>2023-11-13T14:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Filter View Layers</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-view-layers/m-p/1348691#M9281</link>
      <description>&lt;P&gt;Thanks, that was it. I did get hung up for a minute because it appears that if either of those properties is false, instead of just saying false the property is not present.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2023 15:18:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-view-layers/m-p/1348691#M9281</guid>
      <dc:creator>gargarcia</dc:creator>
      <dc:date>2023-11-13T15:18:14Z</dc:date>
    </item>
  </channel>
</rss>

