Scripting Creation of ArcGIS Online Groups with Shared Update and Administrative Group setting using Arcpy

540
2
Jump to solution
04-19-2023 07:35 AM
JosephSia2
New Contributor III

I've tried scripting the creation of groups by referring to this documentation (arcgis.gis module | ArcGIS API for Python)

Unfortunately, it seems like the documentation is incomplete and scripting seems impossible for the type of groups I'm trying to create where settings have to be done at the point of creation.  e.g.

JosephSia2_0-1681914362808.png

 

Not so critical are the group membership settings which can be updated (using scripts?) after the groups are created.

JosephSia2_1-1681914843307.png

 

I do not know what the valid arguments are to certain parameters. Has anyone figured out how the parameters map to the configurations offered in Portal? If not, how do I find the information? Feeling somewhat let down knowing that the method with the likely implementation is there but it cannot be used because of the documentation. 

 

0 Kudos
1 Solution

Accepted Solutions
Clubdebambos
Occasional Contributor III

Hi @JosephSia2 

The API allows for these settings when creating a Group using Python from the documentation in the link arcgis.gis module | ArcGIS API for Python, see example below, the last two parameters handle the Administrative and Shared Update capabilities (leaving_disallowed, and users_update_items respectively)

from arcgis import GIS

agol = GIS("home")

grp_item = agol.groups.create(
    title="My_Group",
    tags="tag1,tag2,tag3",
    description="This is the description for a test group for our fake project",
    snippet="To summarize this is a test group",
    access="private", # private, public, org
    is_invitation_only = True,
    sort_field = "owner", # title, owner, modified, numviews
    sort_order = "asc", # asc or desc
    leaving_disallowed = True, # sets as Administrative
    users_update_items = True # set to Shared Update
)

 

~ learn.finaldraftmapping.com

View solution in original post

2 Replies
Clubdebambos
Occasional Contributor III

Hi @JosephSia2 

The API allows for these settings when creating a Group using Python from the documentation in the link arcgis.gis module | ArcGIS API for Python, see example below, the last two parameters handle the Administrative and Shared Update capabilities (leaving_disallowed, and users_update_items respectively)

from arcgis import GIS

agol = GIS("home")

grp_item = agol.groups.create(
    title="My_Group",
    tags="tag1,tag2,tag3",
    description="This is the description for a test group for our fake project",
    snippet="To summarize this is a test group",
    access="private", # private, public, org
    is_invitation_only = True,
    sort_field = "owner", # title, owner, modified, numviews
    sort_order = "asc", # asc or desc
    leaving_disallowed = True, # sets as Administrative
    users_update_items = True # set to Shared Update
)

 

~ learn.finaldraftmapping.com
JosephSia2
New Contributor III

Have manually created the groups and yet to test this but it looks about right.

Will test it over the weekend.

Many thanks. You've likely saved my automation.

0 Kudos