You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Requirement:
We have around 2200 user id and their corresponding display name and email id in the csv file. Now I have to build a script which will read that csv file and update display name and email id in tableau server.
CSV file has userid, full name, email columns
Approach:
Initially I wrote simple script which will read the csv file and retrieve the user details from tableau server by applying userid as filter.
Then assign email, full name value to that user item and update the user in tableau server.
However, it's updating only to first 8 user id and then it's messing up. So I thought I can apply this update function in batches, so started reading the csv file in batch and applying update function but still its failing.
Does anyone have faced this issue before when updating such huge number of user id's if yes what's the solution followed?
Any help would be greatly appreciated
importsysimporttableauserverclientasTSCimportpandasaspd#Tableau Connectiontableau_auth=TSC.TableauAuth("USERNAME","PWD","site")
server=TSC.Server('server',use_server_version=True)
#Read the data from users list csv filefilename='filepath\\testusers.csv'#Define filter that can be applied while retrieving data from serverreq_option=TSC.RequestOptions()
##rows=pd.Index(df)batchsize=5fordfinpd.read_csv(filename,chunksize=batchsize,skip_blank_lines=True,iterator=True):
forindex,rowindf.iterrows():
withserver.auth.sign_in(tableau_auth):
req_option.filter.add(TSC.Filter(TSC.RequestOptions.Field.Name,TSC.RequestOptions.Operator.Equals,row.iloc[0]))
all_users,pagination_item=server.users.get(req_options=req_option)
user1=TSC.UserItem()
name=row.iloc[0]
user1_id=[user.idforuserinall_users]
user1.id=''.join(user1_id)
user1.fullname=row.iloc[1]
user1.email=row.iloc[2]
user1=server.users.update(user1)
print("user updated")
server.auth.sign_out()
print("signed out")
The text was updated successfully, but these errors were encountered:
Requirement:
We have around 2200 user id and their corresponding display name and email id in the csv file. Now I have to build a script which will read that csv file and update display name and email id in tableau server.
CSV file has userid, full name, email columns
Approach:
Initially I wrote simple script which will read the csv file and retrieve the user details from tableau server by applying userid as filter.
Then assign email, full name value to that user item and update the user in tableau server.
However, it's updating only to first 8 user id and then it's messing up. So I thought I can apply this update function in batches, so started reading the csv file in batch and applying update function but still its failing.
Does anyone have faced this issue before when updating such huge number of user id's if yes what's the solution followed?
Any help would be greatly appreciated
The text was updated successfully, but these errors were encountered: