I am trying to query for all my users and get their email, Role and UserType
item.usertype does not exist
item.role returns something that is not what I am expecting
| Role |
| org_user |
| org_user |
| org_user |
| org_user |
| org_admin |
org_user
|
I am expecting the name of my Roles as seen below... they are custom roles and I need that to eventually set them up..
How do I get the UserName, UserType, UserRole, UserEmail???
user_list = gis.users.search(query=search_user, max_users=200)
with open(output_csv, 'w', encoding='utf-8') as file:
csvfile = csv.writer(file, delimiter=',', lineterminator='\n')
csvfile.writerow(["Name", # these are the headers; modify according to whatever properties you want in your report
"Role",
"UserType",
"Email"
])
for item in user_list:
csvfile.writerow([item.username, # modify according to whatever properties you want in your report
item.role,
item.usertype,
item.email
])