Select to view content in your preferred language

User Categories

1256
9
Jump to solution
11-21-2022 01:54 PM
John_Spence
Frequent Contributor

Has anyone found either in python or via JSON where you can update a user's category? 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
PeterKnoop
MVP Regular Contributor

The documentation for the User update() method indicates it now supports setting categories in the latest version of the ArcGIS API for Python.

View solution in original post

9 Replies
by Anonymous User
Not applicable

Hi John, were you able to find a solution? I'm currently trying to update a user's category via python but my commands aren't working

0 Kudos
John_Spence
Frequent Contributor

Negative....that pattern remains unfilled. 😉

0 Kudos
PeterKnoop
MVP Regular Contributor

The documentation for the User update() method indicates it now supports setting categories in the latest version of the ArcGIS API for Python.

John_Spence
Frequent Contributor

Well call me surprised. I was looking for that the other day and didn't see it. Outstanding news! Thanks for finding it and passing along the info Peter. 🙂

0 Kudos
RobertWeber
Regular Contributor

This works on the actual user but I am having issues getting it to actually add it to the categories listed in my Organization level Members page.

0 Kudos
RobertWeber
Regular Contributor

So in other words it indicates that it should work and it does sort of...but not really

0 Kudos
Theisen
Emerging Contributor

@RobertWeber I am running into the same thing. It says it assigned the category in their profile settings but I don't see it as an option in the organization members tab filter side panel. 

Have you found a workaround or solution to this? 

0 Kudos
RobertWeber
Regular Contributor

 

user.update(categories = ["/Categories/States/Colorado"])

@TheisenThis finally started working for me. Seems like it just takes a minute at times for it to show in the org level categories. 

 

0 Kudos
Theisen
Emerging Contributor

Thanks Robert. I ended up finding something on Github that also worked using the UserManager helper class. Below is the code snippet I grabbed from that thread. 

from arcgis.gis import GIS gis = GIS("home")

cat_users = gis.users.search(query='username:student_user_2')

print(cat_users)

gis.users.assign_categories(users=cat_users, categories=["/Categories/test"])

0 Kudos