Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
When I try to extract the user details using the following code.
import dataiku
client = dataiku.api_client()
dss_users = client.list_users()
user_list = []
# Grab list of All users without Email
for user in dss_users:
if user['enabled'] == True:
user_list.append(user['displayName'])
user_list.append(user['userProfile'])
user_list.append(user['groups'])
user_list.append(user['email'])
print (user_list)
I get an error for the line user_list.append(user['email']) saying that email field can't be detected. But if I run the line user_list.append(user) I could see a field called email for all the users. Can you help me finding out how to extract email address for the users being an admin. Attaching the necessary Pictures for your reference.
Operating system used: windows
Hi @pcharugu,
If you need to have a list of users from the administration group with their user profiles, email addresses, you can use this code:
import dataiku
import pandas as pd
client = dataiku.api_client()
dss_users = client.list_users()
user_list = []
# Grab list of All users without Email
for user in dss_users:
if user['enabled'] == True:
if user['groups'] == ['administrators']:
try:
user_list.append((user['displayName'], user['userProfile'], user['groups'], user['email']))
except:
break
df_users = pd.DataFrame(user_list, columns=["User name", "Profile type", "User Groups", "Email address"])
print(df_users)
This will print pandas dataframe with all the details.