shared_with property on item doesn't display groups

1651
8
02-13-2020 06:35 AM
DavidTinning
New Contributor II

I'm using the ArcGIS Python API to report on items owned by users in my ArcGIS Online organization. 

For each user I loop through their items and check the shared_with property to see which groups the item is shared with but it's always blank even on items I have manually checked that are shared with groups.

Has anyone run into this problem before? 

A snippet from my script is below, the last line is causing the problem. 

# connect to organisation etc....

for user in gis.users.search(max_users=9999):
        for folder in user.folders:
            for item in user.items(folder):
                if not item.shared_with["groups"]:‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
                    # log item

‍‍‍‍‍‍‍‍‍

The result in my watch window in VS code is below. 

For additional info, I'm an admin in the organisation and I'm using version 1.7.0 of the python API. 

8 Replies
JohnKennedy5
New Contributor

Is there any update on this issue? We are having the same problem.

0 Kudos
DavidTinning
New Contributor II

No, I'm afraid I never found a resolution. 

0 Kudos
laurencecuche
New Contributor II

Same problem for me.

I'm admin and items of my users are definitely shared with groups but  shared_with["groups"] always return an empty array...

I'm using version 1.8.1 of the python API. (From ArcGIS Pro's Notebook. Pro Version 2.6.1)

0 Kudos
MarkTurnbull
New Contributor III

Same for me too.

Iterating items from gis.content.search(). shared_with property seems to have correct values for everyone and org properties, but groups is always an empty list, even though the items clearly are shared with groups via the UI

0 Kudos
RobBaxter
New Contributor II

I have recently run into this issue as well - currently using version 1.8.2.

Oddly enough, I have used 'Shared_with' many times before and have never had this issue.

Has anybody had luck in resolving the issue?

0 Kudos
BradKiep
New Contributor III

We are having this same issue now too.  Any luck getting through this?  I have many scripts monitoring our enterprise that rely on reporting the groups for each content item.

0 Kudos
MaryEllen_Perko
Occasional Contributor II

Hi.  Did anyone (or Esri) resolve this issue?  We need to identify agol items that are shared to groups and ideally which groups, and are running into this problem.  Thanks.

gisstaffnapacounty
New Contributor II

We are experiencing this same issue with the shared_with property returning no groups.

0 Kudos