shared_with property on item doesn't display groups

154
5
02-13-2020 06:35 AM
Highlighted
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. 

5 Replies
Highlighted
New Contributor

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

Reply
0 Kudos
Highlighted
New Contributor II

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

Reply
0 Kudos
Highlighted
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)

Reply
0 Kudos
Highlighted
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

Reply
0 Kudos
Highlighted
New Contributor

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?

Reply
0 Kudos