Copying favorites from one user to another

03-28-2019 08:15 AM
New Contributor III

I'm trying to move users from ArcGIS online logins to SSO logins, and one thing I stuck on is favorites.  I can get the list of favorites from the old user using the favGroupId but when I try hen I try to add them to the new user by sharing them to the favGroupId (the way I would with any other group), I just get 'notSharedWith' for all the items.

favs = gis.groups.get(olduser.favGroupId)
for fav in favs.content():
# Full item and group IDs edited out
{'notSharedWith': ['94..aa'], 'itemId': 'b4..34'}
{'notSharedWith': ['94..aa'], 'itemId': 'a5..77'}
{'notSharedWith': ['94..aa'], 'itemId': '64..35'}‍‍‍‍‍‍‍

Is there another way to do this?

Tags (1)
0 Kudos
4 Replies
New Contributor III

It turns out the above code works fine as long as I'm logged in to the gis as the newuser, however that doesn't work for me in this scenario because I can't log in as the target SSO users.

It does not work if I'm just logged in as an admin (which is what I tried above).

I'm still looking for another option.

0 Kudos
New Contributor III

Hi @SeanSweeney, I'm in a similar situation 3.5 years later. Did you figure this one out?

0 Kudos
New Contributor II

Hi @TristanMcHardie,

Sadly, I never did figure this one out. I ended up just sending each user a list of their favorites to re-add themselves, which was painful for everyone.

Since this was a one-time thing for us, I never went back to see if anything was ever added to the API for this.

I'm sorry I can't be more help and I hope you can find a better solution.


Sean Sweeney

New Contributor III

Thanks for replying so quickly! Yes, that's what I've ended up doing as well - sending an email with a list of items. As you say, a one-time thing, so not worth delving further into.

Thanks again,


0 Kudos