AnsweredAssumed Answered

How to query all groups in an ArcGIS Online organization using the ArcGIS API for Python

Question asked by Andrew.Rudin@austintexas.gov_austin on Jun 13, 2018

I want to get a report of all groups in AGOL and their user count via the ArcGIS API for Python. I cannot figure out how to get the function to return all groups.  All the Esri examples have some sort of text filter applied.  The code I'm running from the ArcGIS Pro Python window is below.  At first I tried using the syntax, but this returns the error RuntimeError: Unable to perform group search.'q' parameter must be specified.  Then I tried'*'), which ran without error, but the result is an empty set.


Sample code run from ArcGIS Pro Python window:

from arcgis.gis import GIS

gis = GIS("",clientid='myclientid')

all_groups =

for group in all_groups:

   members = group.get_members()