Hi, I tried to find user by user name using request options however I still got errors until I tried to quote_plus the user name string.
Task:
Find user via user name
[email protected]
Steps
import tableauserverclient as tsc
# .. server sign in etc..
request_options = tsc.RequestOptions()
request_options.filter.add(
tsc.Filter(
tsc.RequestOptions.Field.Name,
tsc.RequestOptions.Operator.Equals,
'[email protected]'
)
)
users, pagination_item = server.users.get(request_options)
print(users)
Expected result
[<User ada95cbc-ca59-4087-bbfe-acbcf55d88a4 [email protected] role=Creator>]
Actual result
[]
This is due to the character + in username.
I'm using quote_plus as a workaround.
import tableauserverclient as tsc
from urllib.parse import quote_plus
# .. server sign in etc..
request_options = tsc.RequestOptions()
request_options.filter.add(
tsc.Filter(
tsc.RequestOptions.Field.Name,
tsc.RequestOptions.Operator.Equals,
quote_plus('[email protected]')
)
)
users, pagination_item = server.users.get(request_options)
print(users)
# [<User ada95cbc-ca59-4087-bbfe-acbcf55d88a4 [email protected] role=Creator>]
Hi, I tried to find user by user name using request options however I still got errors until I tried to
quote_plusthe user name string.Task:
Find user via
user name[email protected]Steps
Expected result
[<User ada95cbc-ca59-4087-bbfe-acbcf55d88a4 [email protected] role=Creator>]Actual result
[]This is due to the character
+inusername.I'm using
quote_plusas a workaround.