<?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: Get the list of Feature layer which contains a specific layer in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-list-of-feature-layer-which-contains-a/m-p/1138282#M7053</link>
    <description>&lt;P&gt;I did not get any layers if I print the "layer_items", I have got a suggestion that &lt;SPAN&gt;a&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;layer&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;doesn't have a&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;title&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;property. The parent item has a title, but the layers have&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;properties&lt;/STRONG&gt;&lt;SPAN&gt;, in which I can find a name.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jan 2022 11:23:19 GMT</pubDate>
    <dc:creator>Aravinthkumar</dc:creator>
    <dc:date>2022-01-28T11:23:19Z</dc:date>
    <item>
      <title>Get the list of Feature layer which contains a specific layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-list-of-feature-layer-which-contains-a/m-p/1136562#M7036</link>
      <description>&lt;P&gt;Hello All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a layer (0) with its name, for example River , I wanted to list all the Feature layers which contain the specific layer (0) River based on the name and JSON file using the API. How can I get the list of feature layers with its Id, owner name using ArcGIS Python API? I can't get the proper idea of it. Kindly guide me.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for any insights.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 19:58:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-list-of-feature-layer-which-contains-a/m-p/1136562#M7036</guid>
      <dc:creator>Aravinthkumar</dc:creator>
      <dc:date>2022-01-24T19:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Get the list of Feature layer which contains a specific layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-list-of-feature-layer-which-contains-a/m-p/1136693#M7038</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/542267"&gt;@Aravinthkumar&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The following code snippet lists up to 100 feature layers which contain "River" in their title along with feature layer owner, and their IDs:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;layer_items = gis.content.search("river", item_type='Feature Service', max_items=100)
for layer in layer_items:
    if "river" in layer.title.lower():
        print(f"Layer name: {layer.title}, \tOwner: {layer.owner}, \tLayer ID: {layer.id}")&lt;/LI-CODE&gt;&lt;P&gt;I hope that's helpful.&lt;/P&gt;&lt;P&gt;Mehdi&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 01:26:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-list-of-feature-layer-which-contains-a/m-p/1136693#M7038</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2022-01-25T01:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: Get the list of Feature layer which contains a specific layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-list-of-feature-layer-which-contains-a/m-p/1136793#M7039</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/43250"&gt;@MehdiPira1&lt;/a&gt;&amp;nbsp;, Thank you for the input, the code runs without any errors but no layer is printed out. I know I have those layers in my portal. Kindly let me know why it is like this ??&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 09:50:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-list-of-feature-layer-which-contains-a/m-p/1136793#M7039</guid>
      <dc:creator>Aravinthkumar</dc:creator>
      <dc:date>2022-01-25T09:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get the list of Feature layer which contains a specific layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-list-of-feature-layer-which-contains-a/m-p/1137751#M7047</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/542267"&gt;@Aravinthkumar&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;What layer items do you get when you run the first line followed by layer_items?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;layer_items = gis.content.search("river", item_type='Feature Service', max_items=100)
layer_items&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 02:03:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-list-of-feature-layer-which-contains-a/m-p/1137751#M7047</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2022-01-27T02:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get the list of Feature layer which contains a specific layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-list-of-feature-layer-which-contains-a/m-p/1138282#M7053</link>
      <description>&lt;P&gt;I did not get any layers if I print the "layer_items", I have got a suggestion that &lt;SPAN&gt;a&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;layer&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;doesn't have a&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;title&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;property. The parent item has a title, but the layers have&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;properties&lt;/STRONG&gt;&lt;SPAN&gt;, in which I can find a name.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 11:23:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-list-of-feature-layer-which-contains-a/m-p/1138282#M7053</guid>
      <dc:creator>Aravinthkumar</dc:creator>
      <dc:date>2022-01-28T11:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: Get the list of Feature layer which contains a specific layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-list-of-feature-layer-which-contains-a/m-p/1138797#M7061</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/542267"&gt;@Aravinthkumar&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;If you mean the layers of a feature layer collection, then the following script should get you the layer name and layer id. Note that the first line is set to all layers but I have put a limit to go through 10 items. However you can change filter and/or increase the max_items value:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;layer_items = gis.content.search("*", item_type='Feature Layer', max_items=10)

for item in layer_items:
    for layer in item.layers:
        for lyr in layer.properties:
            if "river" in layer.properties.name.lower():
                print(f"Layer name: {layer.properties.name}, \tLayer ID: {layer.properties.id}")
                break&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Mehdi&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 06:40:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-list-of-feature-layer-which-contains-a/m-p/1138797#M7061</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2022-01-31T06:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: Get the list of Feature layer which contains a specific layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-list-of-feature-layer-which-contains-a/m-p/1138814#M7062</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/43250"&gt;@MehdiPira1&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you, but this returns results only if the Geometry type of the layer as: &lt;STRONG&gt;esriGeometryPolygon&lt;/STRONG&gt;, but my query has the layer &lt;STRONG&gt;Geometrytype: esriGeometryPoint&lt;/STRONG&gt;, so it doesn't print any layers. What can be done to get the point layers too?&lt;BR /&gt;&lt;BR /&gt;To addition: if the layer name contains capital letters I have changed &lt;STRONG&gt;properties.layer.name.upper()&lt;/STRONG&gt; but what can be done if the layer name has both lower and upper case with numbers.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Kindly help me to understand this.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 10:01:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-list-of-feature-layer-which-contains-a/m-p/1138814#M7062</guid>
      <dc:creator>Aravinthkumar</dc:creator>
      <dc:date>2022-01-31T10:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Get the list of Feature layer which contains a specific layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-list-of-feature-layer-which-contains-a/m-p/1139231#M7066</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/542267"&gt;@Aravinthkumar&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;No, it returns all types of geometry as long as they are&amp;nbsp;&lt;STRONG&gt;Feature Layers&lt;/STRONG&gt; specified in the item_type and you have the right access to them.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;layer.properties.name.upper()&lt;/STRONG&gt;&amp;nbsp;will make all the layer name an upper case, so there is no need to worry about that.&lt;/P&gt;&lt;P&gt;There should be something wrong either with your feature layers (e.g., types or names, ...) or your level of access (role) if you are searching other members' items.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 01:04:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-list-of-feature-layer-which-contains-a/m-p/1139231#M7066</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2022-02-01T01:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get the list of Feature layer which contains a specific layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-list-of-feature-layer-which-contains-a/m-p/1139297#M7068</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/43250"&gt;@MehdiPira1&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am one of the admin in the portal so I have access to all the features and layers, I have used these exact lines of code,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;layer_items = gis.content.search("*", item_type="Feature Layer", max_items=100)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;for item in layer_items:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; print(item.layers)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; for layer in item.layers or []:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for lyr in layer.properties:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if "WETTBEWERBER" in layer.properties.name.upper():&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;print(f"Layer name: {&lt;A href="http://layer.properties.name/" target="_blank" rel="noopener"&gt;layer.properties.name&lt;/A&gt;}, \tLayer ID: {&lt;A href="http://layer.properties.id/" target="_blank" rel="noopener"&gt;layer.properties.id&lt;/A&gt;}, \tFeature layer: {item.layers}")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The part of the printed results are shown below, the printed resutls are for the &lt;STRONG&gt;print(item.layers)&lt;/STRONG&gt; in the third line of the code, even though some have&lt;STRONG&gt; [] empty lists&lt;/STRONG&gt; and &lt;STRONG&gt;None&lt;/STRONG&gt;, I am not sure, why its like this, so the name condition don't satisfy here. To check the name condition I took of the&lt;STRONG&gt; printed URL&lt;/STRONG&gt; and took the &lt;STRONG&gt;name of the layer&lt;/STRONG&gt; from the URL that has given the result but only for the &lt;STRONG&gt;esrigeometryPolygon&amp;nbsp;&lt;/STRONG&gt;not if I take the layer name of the &lt;STRONG&gt;esrigeometryPoint,&amp;nbsp;&lt;/STRONG&gt;Also If I can mention the &lt;STRONG&gt;ID&lt;/STRONG&gt;&amp;nbsp;of the feature layer I can get the layer in the result, but I don't know the ID for all the feature layer which has the exact layer, so this is the problem now.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;[&amp;lt;FeatureLayer&amp;nbsp;url:"&lt;A href="https://maps.com/server/rest/services/MDB2B/FeatureServer/0" target="_blank" rel="noopener"&gt;https://maps.com/server/rest/services/MDB2B/FeatureServer/0&lt;/A&gt;"&amp;gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[&amp;lt;FeatureLayer&amp;nbsp;url:"&lt;A href="https://maps.com/server/rest/services/Hosted/Shape_STRAB/FeatureServer/0" target="_blank" rel="noopener"&gt;https://maps.com/server/rest/services/Hosted/Shape_STRAB/FeatureServer/0&lt;/A&gt;"&amp;gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[&amp;lt;FeatureLayer&amp;nbsp;url:"&lt;A href="https://maps.com/server/rest/services/Hosted/MARKTSTAMM_MARKTSTAMM_PUNKT/FeatureServer/0" target="_blank" rel="noopener"&gt;https://maps.com/server/rest/services/Hosted/MARKTSTAMM_MARKTSTAMM_PUNKT/FeatureServer/0&lt;/A&gt;"&amp;gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[&amp;lt;FeatureLayer&amp;nbsp;url:"&lt;A href="https://maps.com/server/rest/services/Hosted/ShapesOrte2_verbinden/FeatureServer/0" target="_blank" rel="noopener"&gt;https://maps.com/server/rest/services/Hosted/ShapesOrte2_verbinden/FeatureServer/0&lt;/A&gt;"&amp;gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[&amp;lt;FeatureLayer&amp;nbsp;url:"&lt;A href="https://maps.com/server/rest/services/Hosted/SONDERIMMOBILIEN_INT/FeatureServer/0" target="_blank" rel="noopener"&gt;https://maps.com/server/rest/services/Hosted/SONDERIMMOBILIEN_INT/FeatureServer/0&lt;/A&gt;"&amp;gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;None&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[&amp;lt;FeatureLayer&amp;nbsp;url:"&lt;A href="https://maps.com/server/rest/services/Hosted/Marktstamm/FeatureServer/0" target="_blank" rel="noopener"&gt;https://maps.com/server/rest/services/Hosted/Marktstamm/FeatureServer/0&lt;/A&gt;"&amp;gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[&amp;lt;FeatureLayer&amp;nbsp;url:"&lt;A href="https://maps.com/server/rest/services/BEFRAGUNGSC/FeatureServer/0" target="_blank" rel="noopener"&gt;https://maps.com/server/rest/services/BEFRAGUNGSC/FeatureServer/0&lt;/A&gt;"&amp;gt;, &amp;lt;FeatureLayer&amp;nbsp;url:"&lt;A href="https://maps.com/server/rest/services/BEFUSTER_INT/FeatureServer/1" target="_blank" rel="noopener"&gt;https://maps.com/server/rest/services/BEFUSTER_INT/FeatureServer/1&lt;/A&gt;"&amp;gt;, &amp;lt;FeatureLayer&amp;nbsp;url:"&lt;A href="https://maps.com/server/rest/services/BEFRAGUN/FeatureServer/2" target="_blank" rel="noopener"&gt;https://maps.com/server/rest/services/BEFRAGUN/FeatureServer/2&lt;/A&gt;"&amp;gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[&amp;lt;FeatureLayer&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;url:"&lt;A href="https://maps.com/server/rest/services/Hosted/Ortsliste/FeatureServer/0" target="_blank" rel="noopener"&gt;https://maps.com/server/rest/services/Hosted/Ortsliste/FeatureServer/0&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;"&amp;gt;]&lt;BR /&gt;&lt;BR /&gt;Any other insights will be very helpfull, Thank you so much..&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 01 Feb 2022 09:37:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-list-of-feature-layer-which-contains-a/m-p/1139297#M7068</guid>
      <dc:creator>Aravinthkumar</dc:creator>
      <dc:date>2022-02-01T09:37:53Z</dc:date>
    </item>
  </channel>
</rss>

