<?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 Incorrect results from arcgis.groups.search (ArcGIS Python API) for users owning more than 100 groups? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/incorrect-results-from-arcgis-groups-search-arcgis/m-p/875195#M4871</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When using &lt;A href="http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.gis.html?highlight=license#arcgis-gis-groupmanager" rel="nofollow noopener noreferrer" target="_blank"&gt;arcgis.groups.search&lt;/A&gt;&amp;nbsp;(from the &lt;A href="https://developers.arcgis.com/python/" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcGIS Python API&lt;/A&gt;) to return the list of groups for a user on our ArcGIS Online instance, it appears to return incorrect results for users who own more than 100 groups. For instance:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from arcgis.gis import GIS

gis = GIS("&amp;lt;AGO URL&amp;gt;", "&amp;lt;admin username&amp;gt;", "&amp;lt;password&amp;gt;")
users = gis.users.search(query=None, sort_field='username', sort_order='asc', max_users=10000)

for user in users:
 groups_owner = "owner:" + user['username']
 groups_count = len(gis.groups.search(query=groups_owner, max_groups=1000))
 if( groups_count &amp;gt; 0 ):
 print(groups_owner, ",", groups_count)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;For users owning more than 100 groups, the above appears to return a list that has as many items as the value of &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;max_groups&lt;/SPAN&gt;, regardless of how many groups the user actually owns. For instance, for each user owning more than 100 groups, the result list always has 1000 items. And, if you examine the returned list, it is composed of the first 100 groups repeated over and over until the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;max_groups&lt;/SPAN&gt; value is reached.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone else run into this possible bug, and know a way around it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 17:02:03 GMT</pubDate>
    <dc:creator>PeterKnoop</dc:creator>
    <dc:date>2021-12-12T17:02:03Z</dc:date>
    <item>
      <title>Incorrect results from arcgis.groups.search (ArcGIS Python API) for users owning more than 100 groups?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/incorrect-results-from-arcgis-groups-search-arcgis/m-p/875195#M4871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When using &lt;A href="http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.gis.html?highlight=license#arcgis-gis-groupmanager" rel="nofollow noopener noreferrer" target="_blank"&gt;arcgis.groups.search&lt;/A&gt;&amp;nbsp;(from the &lt;A href="https://developers.arcgis.com/python/" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcGIS Python API&lt;/A&gt;) to return the list of groups for a user on our ArcGIS Online instance, it appears to return incorrect results for users who own more than 100 groups. For instance:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from arcgis.gis import GIS

gis = GIS("&amp;lt;AGO URL&amp;gt;", "&amp;lt;admin username&amp;gt;", "&amp;lt;password&amp;gt;")
users = gis.users.search(query=None, sort_field='username', sort_order='asc', max_users=10000)

for user in users:
 groups_owner = "owner:" + user['username']
 groups_count = len(gis.groups.search(query=groups_owner, max_groups=1000))
 if( groups_count &amp;gt; 0 ):
 print(groups_owner, ",", groups_count)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;For users owning more than 100 groups, the above appears to return a list that has as many items as the value of &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;max_groups&lt;/SPAN&gt;, regardless of how many groups the user actually owns. For instance, for each user owning more than 100 groups, the result list always has 1000 items. And, if you examine the returned list, it is composed of the first 100 groups repeated over and over until the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;max_groups&lt;/SPAN&gt; value is reached.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone else run into this possible bug, and know a way around it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 17:02:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/incorrect-results-from-arcgis-groups-search-arcgis/m-p/875195#M4871</guid>
      <dc:creator>PeterKnoop</dc:creator>
      <dc:date>2021-12-12T17:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect results from arcgis.groups.search (ArcGIS Python API) for users owning more than 100 groups?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/incorrect-results-from-arcgis-groups-search-arcgis/m-p/875196#M4872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is confirmed as a bug (&lt;A href="https://my.esri.com/#/support/bugs/BUG-000101507"&gt;BUG-000101507&lt;/A&gt;) with both the 0.3 beta and forthcoming 1.0 release of ArcGIS Python API.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2016 18:23:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/incorrect-results-from-arcgis-groups-search-arcgis/m-p/875196#M4872</guid>
      <dc:creator>PeterKnoop</dc:creator>
      <dc:date>2016-12-15T18:23:30Z</dc:date>
    </item>
  </channel>
</rss>

