Select to view content in your preferred language

Query AGOL content based on group ID

1078
1
Jump to solution
12-30-2022 06:32 PM
JulianaSpector1
Occasional Contributor

I'm attempting to query all of my organization's AGOL content that is a dashboard and within a single group (based on the group ID).

Here is a snippet from my code:

import arcgis

gis = arcgis.gis.GIS("https://www.arcgis.com", "username", "password")

dashboardItems = gis.content.search(query="id:groupID", item_type="Dashboard", max_items=9999)


I end up returning no items in the query even though there are multiple dashboards in my group content. I'm wondering if the issue has to do with the fact that both item and group IDs can be queried using the id field and maybe the query is trying to find a matching item ID (instead of group ID)?

0 Kudos
1 Solution

Accepted Solutions
DanielMiranda2
Regular Contributor

It looks like based on the Search reference—ArcGIS REST APIs | ArcGIS Developers the format is

query = "group:groupID"

It is mentioned in the "Item Fields" table about halfway down that reference page.

View solution in original post

0 Kudos
1 Reply
DanielMiranda2
Regular Contributor

It looks like based on the Search reference—ArcGIS REST APIs | ArcGIS Developers the format is

query = "group:groupID"

It is mentioned in the "Item Fields" table about halfway down that reference page.

0 Kudos