Hi all, I'm trying to use ArcGIS Notebooks to view dependencies between items for some cleaning up in ArcGIS Online (not Enterprise).
I found the to_dependencies property in the API reference: https://developers.arcgis.com/python/latest/api-reference/arcgis.gis.toc.html#arcgis.gis.ItemDepende..., but it doesn't seem to return anything.
from arcgis.gis import GIS
import pandas as pd
gis = GIS("home")
item = gis.content.get('<itemid goes in here>')
# Get dependencies
dependencies = item.dependencies
print(dependencies)
print(dependencies.properties)
print(dependencies.to_dependencies)
However, passing in the ID of a hosted feature layer that I know is used in multiple web maps and apps returns nothing:
<Dependencies for <item id is displayed here>> { "items": [] } []
If I pass in the ID of a Web Map that has multiple layers within it, I also get no dependencies:
<Dependencies for <item id is displayed here>> { "items": [] } []
I've seen in the documentation that the dependent_upon and dependent_to methods only work in ArcGIS Enterprise, but there is nothing in the documentation that says that the to_dependencies doesn't work in ArcGIS Online.
What am I missing here? Is to_dependencies deprecated?
Hi @MappyIan, you can use the below tool to report an item's dependencies:
Thanks @JakeSkinner, that's really helpful. There are quite a few variants of this tool kicking around (e.g. here) but I hadn't found your tool.
I got the tool to work, which is great, but I have high hopes that this functionality will be added to ArcGIS Online in the next release (February 2025) as suggested in the replies to this particular idea (see page 2). This idea was logged back in 2023, which suggests that has long been a need for this sort of functionality in the core product.
Came here looking for the reason I'm getting exactly the same output from the item.dependencies property as @MappyIan: just a bunch of empty lists for everything in my portal (where I know there are plenty of dependencies).
Looking through the toolbox now and it doesn't use the item dependencies property / ItemDependency object either, assuming because this simply doesn't work at the moment? (One wonders why the entries are still in the API reference, then?) Am I being too optimistic hoping that the reason it's not fixed is that this that dependency reporting is close to being implemented in a GUI in AGOL? 🤣
In any case I'll probably implement the approach being taken in the toolbox; looks straightforward. Thanks for the solution @JakeSkinner