<?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: Layers are not listed in search in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/layers-are-not-listed-in-search/m-p/739906#M278</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This was a bug in version 1.5.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When logging into AGOL with OAuth2.0 using an Enterprise account, the admin module is not included in the GIS object, so only public items are returned in a search. If you connect to AGOL with a built in account (using a username and password), the GIS object does contain the admin module, so all content is returned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This bug was fixed in 1.6.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 May 2019 20:44:01 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2019-05-15T20:44:01Z</dc:date>
    <item>
      <title>Layers are not listed in search</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/layers-are-not-listed-in-search/m-p/739905#M277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm writing code for a notebook that will search for a specific item in my content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;getFeatureLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layername&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; i&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    queryString &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'title: '&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; layername &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;' AND owner: '&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;properties&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;user&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;username 
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;queryString&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    layer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;search&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;query &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; queryString&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; item_type &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Feature Layer'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; i&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; layer
    &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import csv
with open('data/users.csv') as csvfile:
    reader = csv.DictReader(csvfile)
    for row in reader:
        user = gis.users.get(row['username'])
        searchlayer = 'WCC_' + row['groupname']
        print(searchlayer)
        layer = getFeatureLayer(searchlayer)
        print(layer)
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, this is not returning layers that exist in my content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;WCC_1Testing title: WCC_1Testing AND owner: Ken.Buja_noaa None&lt;/PRE&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/447519_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried this with other content that I own and it doesn't return the item either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I try this with content elsewhere in the organization, it does return layers. Is this because my content that I'm search on hasn't been shared with the organization?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:29:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/layers-are-not-listed-in-search/m-p/739905#M277</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-12T07:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: Layers are not listed in search</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/layers-are-not-listed-in-search/m-p/739906#M278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This was a bug in version 1.5.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When logging into AGOL with OAuth2.0 using an Enterprise account, the admin module is not included in the GIS object, so only public items are returned in a search. If you connect to AGOL with a built in account (using a username and password), the GIS object does contain the admin module, so all content is returned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This bug was fixed in 1.6.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 May 2019 20:44:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/layers-are-not-listed-in-search/m-p/739906#M278</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2019-05-15T20:44:01Z</dc:date>
    </item>
  </channel>
</rss>

