<?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: ArcGIS API for Python: Change limit of 10 on the number of results returned? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-change-limit-of-10-on-the/m-p/1082957#M6396</link>
    <description>&lt;P&gt;Hi! I ran into the same problem. I needed to reliably get a list of *all* dependencies of an item, not just maximum 10. I was very surprised also, that the Docs does not mention this. The returned structure of Item.dependent_to() does hint or somehow suggest, that it must be called repeatedly to build up the full results. My workaround was to use the Item.dependencies property:&lt;/P&gt;&lt;P&gt;deps = dict(self.item.dependencies.properties)['items']&lt;BR /&gt;deps = [d['id'] for d in deps if 'id' in d.keys()]&lt;BR /&gt;deps = [webgis.content.get(id) for id in deps]&lt;/P&gt;&lt;P&gt;Btw clicking text formatting buttons in this Forum does nothing with a modern Chrome Browser. Yay!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jul 2021 07:03:26 GMT</pubDate>
    <dc:creator>Glasnost</dc:creator>
    <dc:date>2021-07-27T07:03:26Z</dc:date>
    <item>
      <title>ArcGIS API for Python: Change limit of 10 on the number of results returned?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-change-limit-of-10-on-the/m-p/783995#M1321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I understand that the&amp;nbsp;GIS.content.search() has a max_items parameter, but what about all of the other tools? Is there a property that can be set in the GIS object or anywhere else?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take the item.dependent_to() method for example. The documentation does not list any parameters or make any mention that a limit exists in the first place:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;CODE class=""&gt;dependent_to&lt;/CODE&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.dependent_to" style="color: #404040; font-weight: normal; text-decoration: none; font-size: 14.4px;" title="Permalink to this definition" rel="nofollow noopener noreferrer" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.dependent_to&lt;/A&gt;&lt;/P&gt;&lt;P style="font-size: 16px; margin: 0px 0px 12px;"&gt;Returns items, urls, etc that are dependent to this item. This capability (item dependencies) is not yet available on ArcGIS Online. Currently it is available only with an ArcGIS Enterprise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A python example:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gis &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; GIS

g &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;profile&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'xxx'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Connected to: {}\nConnected as: {}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt; g&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;url &lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;g&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;users&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;me&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;username&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


id_of_interest &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'bd9902d1c85c4bfab5636af782a89219'&lt;/SPAN&gt;
item_of_Interest &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; g&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;id_of_interest&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

dep_to &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; item_of_Interest&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dependent_to&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;dep_to&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'list'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;### Returns 10 ###&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;/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;Returns 10 items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My workaround function is relatively slow but proves that there are 44 dependencies:&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;Find_WMs_using_layer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layer_item&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; webmaps_list&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; webmaps_list&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        webmaps_list &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; g&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;&lt;SPAN class="string token"&gt;"*"&lt;/SPAN&gt;&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;"Web Map"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; max_items &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;300&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outside_org&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'%s webmaps found in portal'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt; len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;webmaps_list&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    
    id_of_interest &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; layer_item&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;id

    out_webmaps &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"{:-&amp;lt;50}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    lyr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; wm &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; webmaps_list&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        raw_data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; wm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get_data&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        lyrs &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; raw_data&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'operationalLayers'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; lyr &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; lyrs&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'itemId'&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;keys&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'itemId'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; id_of_interest&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
                &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"\t %s contains layer of interest as %s"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt; wm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;title&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'title'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                
                out_webmaps&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;wm&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                
    &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; out_webmaps


id_of_interest &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'bd9902d1c85c4bfab5636af782a89219'&lt;/SPAN&gt;
item_of_Interest &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; g&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;id_of_interest&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


webmaps &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Find_WMs_using_layer&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;item_of_Interest&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; webmaps_list&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;webmaps&lt;SPAN class="punctuation token"&gt;)&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;/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;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;Returns 44 webmaps that contain a layer using the item ID provided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same behavior is displayed for the dependent_upon() method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know a way to alter the 10 item max?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are there any other methods that display this behavior we can compile a list of tools?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:56:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-change-limit-of-10-on-the/m-p/783995#M1321</guid>
      <dc:creator>DanielGermroth1</dc:creator>
      <dc:date>2021-12-12T08:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS API for Python: Change limit of 10 on the number of results returned?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-change-limit-of-10-on-the/m-p/1082957#M6396</link>
      <description>&lt;P&gt;Hi! I ran into the same problem. I needed to reliably get a list of *all* dependencies of an item, not just maximum 10. I was very surprised also, that the Docs does not mention this. The returned structure of Item.dependent_to() does hint or somehow suggest, that it must be called repeatedly to build up the full results. My workaround was to use the Item.dependencies property:&lt;/P&gt;&lt;P&gt;deps = dict(self.item.dependencies.properties)['items']&lt;BR /&gt;deps = [d['id'] for d in deps if 'id' in d.keys()]&lt;BR /&gt;deps = [webgis.content.get(id) for id in deps]&lt;/P&gt;&lt;P&gt;Btw clicking text formatting buttons in this Forum does nothing with a modern Chrome Browser. Yay!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 07:03:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-change-limit-of-10-on-the/m-p/1082957#M6396</guid>
      <dc:creator>Glasnost</dc:creator>
      <dc:date>2021-07-27T07:03:26Z</dc:date>
    </item>
  </channel>
</rss>

