<?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: Retrieving all feature layer views with View Manager list() in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/retrieving-all-feature-layer-views-with-view/m-p/1341097#M9187</link>
    <description>&lt;P&gt;Thanks for the info -- do you have any resources/references on those that you could point me towards? haha&lt;/P&gt;</description>
    <pubDate>Tue, 24 Oct 2023 19:36:30 GMT</pubDate>
    <dc:creator>GIS_utahDEM</dc:creator>
    <dc:date>2023-10-24T19:36:30Z</dc:date>
    <item>
      <title>Retrieving all feature layer views with View Manager list()</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/retrieving-all-feature-layer-views-with-view/m-p/1341052#M9183</link>
      <description>&lt;P&gt;I am trying to return a list of all feature layer views of a specific item. I am able to successfully do this with the arcgis.gis ViewManager .list() &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.ViewManager:~:text=objects%20or%20None.-,list(),List%20of%20feature%20layer%20view%20items,-update(layer_def" target="_self"&gt;method&lt;/A&gt;, however it only returns the first 100 (I know, I've got a lot of view layers). Is there a way to overrule this and make it return all of them? I should have about 350 for every jurisdiction in my state.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 18:04:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/retrieving-all-feature-layer-views-with-view/m-p/1341052#M9183</guid>
      <dc:creator>GIS_utahDEM</dc:creator>
      <dc:date>2023-10-24T18:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving all feature layer views with View Manager list()</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/retrieving-all-feature-layer-views-with-view/m-p/1341058#M9184</link>
      <description>&lt;P&gt;I can't say that's a limitation I've run into, but if you connect to the Views endpoint of the REST API, can you see all 350 or so there?&amp;nbsp; The URL would be something like this:&lt;/P&gt;&lt;P data-unlink="true"&gt;https://services350.arcgis.com/somerandomchars/ArcGIS/rest/services/YourRootService/FeatureServer/views?f=json&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;Probably need a token in there too...&lt;/P&gt;&lt;P data-unlink="true"&gt;Anyhow, does that endpoint only show 100 views?&amp;nbsp; If so, it's probably a limitation of the REST API rather than the Python API.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 18:14:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/retrieving-all-feature-layer-views-with-view/m-p/1341058#M9184</guid>
      <dc:creator>MobiusSnake</dc:creator>
      <dc:date>2023-10-24T18:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving all feature layer views with View Manager list()</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/retrieving-all-feature-layer-views-with-view/m-p/1341072#M9185</link>
      <description>&lt;P&gt;I'm not sure I follow how to get to that link (it asks for a token but I'm not sure how to generate one?), but if I view the REST Services Directory for the Views from the feature layer I'm able to see all of them...does that help?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 18:50:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/retrieving-all-feature-layer-views-with-view/m-p/1341072#M9185</guid>
      <dc:creator>GIS_utahDEM</dc:creator>
      <dc:date>2023-10-24T18:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving all feature layer views with View Manager list()</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/retrieving-all-feature-layer-views-with-view/m-p/1341082#M9186</link>
      <description>&lt;P&gt;Yeah, that does seem to indicate it's a limitation of the API then.&lt;/P&gt;&lt;P&gt;If you can't find a workaround using the Python API, you could connect to that page/endpoint using the requests module, urllib, etc. and get the full list that way.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 19:12:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/retrieving-all-feature-layer-views-with-view/m-p/1341082#M9186</guid>
      <dc:creator>MobiusSnake</dc:creator>
      <dc:date>2023-10-24T19:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving all feature layer views with View Manager list()</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/retrieving-all-feature-layer-views-with-view/m-p/1341097#M9187</link>
      <description>&lt;P&gt;Thanks for the info -- do you have any resources/references on those that you could point me towards? haha&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 19:36:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/retrieving-all-feature-layer-views-with-view/m-p/1341097#M9187</guid>
      <dc:creator>GIS_utahDEM</dc:creator>
      <dc:date>2023-10-24T19:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving all feature layer views with View Manager list()</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/retrieving-all-feature-layer-views-with-view/m-p/1341113#M9188</link>
      <description>&lt;P&gt;It looks like the problem is the logic as written doesn't incorporate paging.&amp;nbsp;&lt;SPAN&gt;ViewManager.list() uses the&amp;nbsp;&lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/related-items.htm" target="_blank" rel="noopener"&gt;relatedItems&lt;/A&gt;&lt;/SPAN&gt;&amp;nbsp;endpoint which itself &lt;STRONG&gt;does&lt;/STRONG&gt; support paging. The supporting method that needs to be updated is&amp;nbsp;&lt;EM&gt;&lt;SPAN&gt;related_items&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;in arcgis/gis/__init__.py.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You&amp;nbsp;&lt;EM&gt;could&lt;/EM&gt; fix it rather easily by introducing a while loop and adding "start" and "num" parameters in the postdata. The num value should be 100 based on what you've shared. If you decide to give this a try, I would recommend experimenting in a new python environment as changes to the source voids technical support.&lt;/P&gt;&lt;P&gt;I've not tested this, but something like this should get you more or less started (you will need to open/save the file as an Administrator):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    def related_items(self, rel_type: str, direction: str = "forward"):
        if rel_type not in self._RELATIONSHIP_TYPES:
            raise Error("Unsupported relationship type: " + rel_type)
        if not direction in self._RELATIONSHIP_DIRECTIONS:
            raise Error("Unsupported direction: " + direction)

        related_items = []

        postdata = {"f": "json"}
        postdata["relationshipType"] = rel_type
        postdata["direction"] = direction
        postdata["num"] = 100
        postdata["start"] = 0
        keep_going = True
        while keep_going:
            resp = self._portal.con.post(
                "content/items/" + self.itemid + "/relatedItems", postdata
            )
            if len(resp["relatedItems"]) &amp;gt; 0:
                postdata["start"] = postdata["start"] + 100
                for related_item in resp["relatedItems"]:
                    related_items.append(Item(self._gis, related_item["id"], related_item))
            else:
                keep_going = False
        return related_items&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In any case, I would recommend logging an enhancement with Esri Technical Support for paging to be added.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 20:11:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/retrieving-all-feature-layer-views-with-view/m-p/1341113#M9188</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2023-10-24T20:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving all feature layer views with View Manager list()</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/retrieving-all-feature-layer-views-with-view/m-p/1341174#M9190</link>
      <description>&lt;P&gt;I don't know of any Esri resources that show how to use the REST API with Python, but the full REST API documentation is here (it's language-agnostic, however):&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/rest/" target="_blank"&gt;https://developers.arcgis.com/rest/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here's some doc on using the requests module, it's really handy if you're not familiar with it, I use it all the time to access non-GIS data:&lt;/P&gt;&lt;P&gt;&lt;A href="https://requests.readthedocs.io/en/latest/" target="_blank"&gt;https://requests.readthedocs.io/en/latest/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 21:42:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/retrieving-all-feature-layer-views-with-view/m-p/1341174#M9190</guid>
      <dc:creator>MobiusSnake</dc:creator>
      <dc:date>2023-10-24T21:42:03Z</dc:date>
    </item>
  </channel>
</rss>

