Identify and work with items in a group

279
3
Jump to solution
08-13-2019 04:21 PM
AllenScully
Occasional Contributor II

Very simple issue (and can do it manually, but what's the fun in that?) - Just want to mark all of the items (they are all feature layers) in a group as authoritative.

I get the group - but can't figure out how to start working with the items in that group.  All documentation I have found is about group members, and acting on them.  

I'd like just to use the group as an identifier of items/content, and then the rest is easy as far as marking as authoritative.

grps = portal.groups.search(query = 'title: mygroupname')
grp.get_items()

Obviously that doesn't work but that's the gist of what I'd like.

Thanks - 

Allen

0 Kudos
1 Solution

Accepted Solutions
MehdiPira1
Esri Contributor

Allen Scully‌, Here's the code you can use to access the group items to work with:

groups = gis.groups.search(query = 'title: "GROUP NAME"')
for group in groups:
for group_item in group.content():
print(group_item)‍‍‍‍

View solution in original post

3 Replies
MehdiPira1
Esri Contributor

Allen Scully‌, Here's the code you can use to access the group items to work with:

groups = gis.groups.search(query = 'title: "GROUP NAME"')
for group in groups:
for group_item in group.content():
print(group_item)‍‍‍‍

View solution in original post

AllenScully
Occasional Contributor II

Thanks Mehdi - 

Of course it's that easy when you know how!  Much appreciated.

Allen

0 Kudos
MehdiPira1
Esri Contributor

Not a problem, Allen.

0 Kudos