Arcgis API for Python - List Group Members

162
2
Jump to solution
06-05-2020 02:07 PM
Highlighted
Occasional Contributor III

This is the explanation for how to list group members in ArcGIS API for Python documentation. I don't see any way to get an actual list of group members here. When I do this on my groups, I get the words "owner" "admins" users"

I feel like there is a big missing part here. Could someone help me find it?

Thank you,

Randy McGregor

Listing users belonging to a grouphttps://developers.arcgis.com/python/guide/accessing-and-managing-groups/#Listing-users-belonging-to...

You can list the users in a group by calling the get_members() method. The method returns a dictionary that not only gives you the member list, but also the owner, admin and users.

In [27]:
geocaching_group.get_members()
Out[27]:
{'owner': 'arcgis_python',  'admins': ['arcgis_python'],  'users': ['api_data_owner']}
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Esteemed Contributor

Hi Randy,

The users will be the group members:

arcgis.gis module — arcgis 1.8.0 documentation 

The following should provide the users:

geocaching_group.get_members()['users']

View solution in original post

2 Replies
Highlighted
Esri Esteemed Contributor

Hi Randy,

The users will be the group members:

arcgis.gis module — arcgis 1.8.0 documentation 

The following should provide the users:

geocaching_group.get_members()['users']

View solution in original post

Highlighted
Occasional Contributor III

Thank you!

I knew it was simple. I'm just not yet proficient the structure of JSON.

This did it:

member = group.get_members()

for member in members['users']:

  print(member)

Reply
0 Kudos