-
Notifications
You must be signed in to change notification settings - Fork 436
Fullname and email #278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Seems like the problem is that user.fullname and user.email are the two fields that are not returned by our Rest API by default. Using the Rest API, you could get those two fields by using the 'fields' parameter to expand your query (https://onlinehelp.tableau.com/current/api/rest_api/en-us/help.htm#REST/rest_api_concepts_fields.htm%3FTocPath%3DConcepts%7C_____8) Currently, however, TSC does not support using the 'fields' parameter, so there is no way to get user.fullname and user.email. I'll add this to our backlog. |
req_option = tsc.RequestOptions() Output: Please could you update us when the fullname attribute is fixed to display full name. so for ID xyz, I except to see Zen XY. |
Hello, |
It seems that a lot of fields aren't returned by the Rest API by default.
Thanks. |
Hi, |
I had the same problem. It's ok if this feature isn't programmed yet, but the documentation should match current production. Please remove https://tableau.github.io/server-client-python/docs/api-ref#users |
server.users.get_by_id() returns |
Hello - has there been any update to returning the email address? We need to retrieve the email address for a specified user and can't move due to this.
|
+1 for being able to return email address |
For As for |
For |
In Tableau Server 2019.4 it still seems to return none. |
@capnwes could you confirm which specific version of 2019.4 you are using? The latest maintenance release there is 2019.4.17 and that should have the server-side part of this fix Chris mentioned. |
@bcantoni We are running Tableau Server Version: 2019.4.3 (20194.20.0128.2054) 64-bit Windows.
I used this (but with an ID from my server) as a test case. edit: |
@capnwes ahh okay, thanks for confirming. The fix here requires both using the latest TSC library and being on the latest maintenance releases for Tableau Server. So for your case that would be 2019.4.17. When your server is upgraded to that version then this should work for you. |
Oh, whoops! Thanks for clearing that up for me @bcantoni . |
#565
import tableauserverclient as TSC
tableau_auth = TSC.TableauAuth('USERNAME', 'PASSWORD')
server = TSC.Server('https://SERVERURL')
with server.auth.sign_in(tableau_auth):
all_users, pagination_item = server.users.get()
for user_item in all_users:
print("User name: '{}' fullname: '{}', User email: '{}'".format(user_item.name,
user_item.fullname,
user_item.email))
# =>
# User name: 'username123' fullname: 'User Name123', User email: 'uname@nd.edu' |
I'll go ahead and close this one based on the recent confirmations. |
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I have a python script utilizing the Tableau Server Client (TSC). I am trying to pull down information about the users. Below is the code, slightly modified from the example given online from the Tableau Github page (https://tableau.github.io/server-client-python/docs/api-ref#requests).
Just to be clear...I am using a server administrator account to pull the data.
Using the link above as a reference, scroll down to “Users”. Just below will show the attributes available in the UserItem class. You will see 'name', site_role','fullname' and 'email' are included in that list.
When I try to query the API for 'fullname' and 'email' I get “None”. According to documentation Tableau populates the email address and display name with info from AD during import. When I log into Tableau, the two fields are populated as expected. But as stated, when I do a pull using TSC, it pulls back nothing. I don’t think it’s my code as I am not getting errors. And I am using two other attributes (name and site_role) that both pull back the correct information when queried. See below for the code I am using.
---Works---
with server.auth.sign_in(tableau_auth):
all_users, pagination_item = server.users.get()
UsersDB = [(user.name,user.site_role) for user in all_users]
What I want to do is include 'user.fullname' and 'user.email' in the above query. But when I do I get "None" as my results for those two attributes only, 'user.name' and 'user.site_role' both pull back data.
---Does not work correctly----
with server.auth.sign_in(tableau_auth):
all_users, pagination_item = server.users.get()
UsersDB = [(user.fullname,user.name,user.site_role,user.email) for user in all_users]
SIDE NOTE: I have been reviewing the user_item.py file to see if something was overlooked. I am NOT an expert with classes so I am not really sure what am looking at. However I don't think properties were declared for email and full name. I tried added them and get errors saying things like "inconsistent use of tabs and spaces in indentation". When I replace and existing property to avoid this error I get an error saying "can't set attribute". So I obviously don't understand this file. I need this information for a work project.
Here is the file I was reviewing....
https://github.com/tableau/server-client-python/blob/master/tableauserverclient/models/user_item.py
I was messing with "def init" and the '@properties' below it.
Please advise.
EDIT:
SIDE NOTE clear up - I figured out the tabs and spacing issue. Apparently it didn't like it when I tabbed for indentation. So I put 4 spaces every for my issues and it solved that issue.
Once I cleared up that, I get an error like "fullname must not be empty".
The text was updated successfully, but these errors were encountered: