Select to view content in your preferred language

Dependencies: arcgis.gis.ItemDependency.to_dependencies not returning dependent items

258
2
02-20-2025 08:37 AM
Labels (1)
MappyIan
Frequent Contributor

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?

0 Kudos
2 Replies
JakeSkinner
Esri Esteemed Contributor
0 Kudos
MappyIan
Frequent Contributor

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.

0 Kudos