AnsweredAssumed Answered

Python "group" object in Item properties dictionary ? 

Question asked by H.Bouckaert_westernpower on Oct 29, 2018
Latest reply on Oct 29, 2018 by APulver-esristaff

Hi 

 

I want to find out which AGOL groups particular objects belong to, and in doing so seem to have come across a python  "group" object within a dictionary, which is difficult to access. I looked it up and the only "group type" object in python I find reference to is h5py "group" objects, but that is not it.

 

So this is what I am trying to do: I have an AGOL item, and I want to know what AGOL groups this item belongs to. This information can be found when calling "shared_with", which returns a dictionary: 

 

print (item.shared_with)

 

This returns:  

 

{'everyone': False, 'org': False, 'groups': [<Group title:"Group name" owner:some_user>]}

 

I thought that what is (within the dictionary) in the list i.e. between [  and  ] is a string i.e I though that this is a string:

 

<Group title:"Group name" owner:some_user>   

 

But when I use some string functions on it, like split, it complains that this is not a string object:

 

AttributeError: 'Group' object has no attribute 'split'

 

(I know the use of the term "group" is confusing here, I am looking for AGOL groups and the name 'group' also appears in what is returned between < >), but what I think is what is between < > is  also some sort of a python "group" object.)  

 

So whatever is between <   and   >  is a python "group" object? To be honest I have never heard of it and googling does not help either. Anyone knows what kind of object this is and how to access it? It is not a string, that's for sure.    

 

Thanks

 

Hugo 

Outcomes