<?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: Find view's source HFL when you don't own it? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-view-s-source-hfl-when-you-don-t-own-it/m-p/1539281#M10675</link>
    <description>&lt;P&gt;You can update this script to return all users items in the search. Add for loop on fly and if logic for&amp;nbsp;layerViews or sourceServiceName presence, to return view or source and associated views/source for the item.&lt;/P&gt;</description>
    <pubDate>Tue, 17 Sep 2024 06:33:18 GMT</pubDate>
    <dc:creator>ChristopherCounsell</dc:creator>
    <dc:date>2024-09-17T06:33:18Z</dc:date>
    <item>
      <title>Find view's source HFL when you don't own it?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-view-s-source-hfl-when-you-don-t-own-it/m-p/1539053#M10670</link>
      <description>&lt;P&gt;I need to programmatically change ownership of a &lt;EM&gt;view&lt;/EM&gt;. This requires that I first find the &lt;EM&gt;service&lt;/EM&gt; with which the view is associated and change the ownership of that service. I had good luck with this until I tried it on content I don't own:&lt;/P&gt;&lt;P&gt;This code produces an empty list. 'check_item' is a feature service view.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;source_hfl_list = check_item.related_items(rel_type="Service2Data",direction="reverse")
print(str(source_hfl_list))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do have admin privileges. Is there any way to get this information that doesn't require me to own the items? I can change ownership in the service itself 'manually' but scaring it up is a bit of a hassle and I'd like to do it from a notebook that accesses the view only.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Randy McGregor&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 18:08:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-view-s-source-hfl-when-you-don-t-own-it/m-p/1539053#M10670</guid>
      <dc:creator>RandyMcGregor_BMcD</dc:creator>
      <dc:date>2024-09-16T18:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Find view's source HFL when you don't own it?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-view-s-source-hfl-when-you-don-t-own-it/m-p/1539280#M10674</link>
      <description>&lt;P&gt;To run this with .related_items you need to be the item owner or the&amp;nbsp;&lt;EM&gt;default&lt;/EM&gt; administrator (not a custom role with admin privileges).&lt;/P&gt;&lt;P&gt;You can achieve this by viewing the layer definition admin properties.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis import GIS
from arcgis.features import FeatureLayerCollection

gis = GIS("Home")

source_item = gis.content.search("xxxxxxxxxxxxxxxxxxxxxxxx")[0]
flc = FeatureLayerCollection.fromitem(source_item)
print(flc.layers[0].manager.properties.adminLayerInfo.viewLayerDefinition.sourceServiceName)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 06:29:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-view-s-source-hfl-when-you-don-t-own-it/m-p/1539280#M10674</guid>
      <dc:creator>ChristopherCounsell</dc:creator>
      <dc:date>2024-09-17T06:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Find view's source HFL when you don't own it?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-view-s-source-hfl-when-you-don-t-own-it/m-p/1539281#M10675</link>
      <description>&lt;P&gt;You can update this script to return all users items in the search. Add for loop on fly and if logic for&amp;nbsp;layerViews or sourceServiceName presence, to return view or source and associated views/source for the item.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 06:33:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-view-s-source-hfl-when-you-don-t-own-it/m-p/1539281#M10675</guid>
      <dc:creator>ChristopherCounsell</dc:creator>
      <dc:date>2024-09-17T06:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Find view's source HFL when you don't own it?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-view-s-source-hfl-when-you-don-t-own-it/m-p/1540001#M10684</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/719826"&gt;@RandyMcGregor_BMcD&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I had the same issue, I was getting an empty list [] with "Service2Data", but worked with "Service2Service", returned a list with one entry, the Item object representing the the source Feature Service.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS

## access ArcGIS Online
agol = GIS("home")

## get the view as an Item object
view_item = agol.content.get("VIEW_ITEM_ID")

## get the source item from the related_items()
source_item = view_item.related_items(
    rel_type = "Service2Service",
    direction = "reverse"
)[0] # get the item object from the list

print(source_item)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 18 Sep 2024 15:42:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-view-s-source-hfl-when-you-don-t-own-it/m-p/1540001#M10684</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2024-09-18T15:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: Find view's source HFL when you don't own it?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-view-s-source-hfl-when-you-don-t-own-it/m-p/1540520#M10687</link>
      <description>&lt;P&gt;I tried both service2service and service2data. I think the ownership issue Chris mentioned is the culprit. I have a custom role with admin privileges.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 17:53:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-view-s-source-hfl-when-you-don-t-own-it/m-p/1540520#M10687</guid>
      <dc:creator>RandyMcGregor_BMcD</dc:creator>
      <dc:date>2024-09-19T17:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Find view's source HFL when you don't own it?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-view-s-source-hfl-when-you-don-t-own-it/m-p/1541086#M10691</link>
      <description>&lt;P&gt;&lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/related-items/" target="_blank"&gt;https://developers.arcgis.com/rest/users-groups-and-items/related-items/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Only default administrators and item owners have access to related items.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This applies to the function and relationship type parameters.&lt;/P&gt;&lt;P&gt;I've tested the earlier script with a custom admin role and it works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2024 22:02:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-view-s-source-hfl-when-you-don-t-own-it/m-p/1541086#M10691</guid>
      <dc:creator>ChristopherCounsell</dc:creator>
      <dc:date>2024-09-20T22:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Find view's source HFL when you don't own it?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-view-s-source-hfl-when-you-don-t-own-it/m-p/1544714#M10726</link>
      <description>&lt;P&gt;I did a slightly different thing, but used this concept. Our naming conventions are very standardized so I am able to remove the word "_View" from the item title. 99% of the time this is the hosted feature layer name. Then I can list layers with this name (which includes views made from it, somewhat confusingly...) then check for typeKeyword &lt;EM&gt;does &lt;STRONG&gt;not&lt;/STRONG&gt; include&lt;/EM&gt; 'View Service.' That gives me the HFL.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Randy McGregor&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 13:07:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-view-s-source-hfl-when-you-don-t-own-it/m-p/1544714#M10726</guid>
      <dc:creator>RandyMcGregor_BMcD</dc:creator>
      <dc:date>2024-10-02T13:07:44Z</dc:date>
    </item>
  </channel>
</rss>

