Skip to content
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

[Type 3] [Search for users by email] #1562

Open
jorwoods opened this issue Feb 3, 2025 · 2 comments
Open

[Type 3] [Search for users by email] #1562

jorwoods opened this issue Feb 3, 2025 · 2 comments
Labels
enhancement needs investigation Issue needs to be looked at by Tableau

Comments

@jorwoods
Copy link
Contributor

jorwoods commented Feb 3, 2025

Summary

The user filters should support filtering based on email eq and email in.

****Type 3: new functionality**** Requests for totally new functionality will generally be passed to the relevant dev team, but we probably can't give any useful estimate of how or when it might be implemented. If it is a feature that is 'about' the API or programmable access, here might be the best place to suggest it, but generally feature requests will be more visible in the [Tableau Community Ideas](https://community.tableau.com/s/ideas) forum and should go there instead.

Description

A clear and concise description of what the feature request is. If you think that the value of this feature might not be obvious, include information like how often it is needed, amount of work saved, etc. If your feature request is related to a file or server in a specific state, describe the starting state when the feature can be used, and the end state after using it. If it involves modifying files, an example file may be helpful.

Currently the user filter supports searching based on name, luid, friendlyName, and a few other fields. As mentioned in #907:

Note: Filter expressions can’t contain ampersand (&) or comma (,) characters because these characters are used as field expression separators. This is true even if those characters are encoded.

so most servers I have interacted with, friendlyName does not work for searching due to names showing up as "Last, First." Searching by email will offer up a convenient way to find intended users.

@jorwoods jorwoods added enhancement needs investigation Issue needs to be looked at by Tableau labels Feb 3, 2025
@jorwoods
Copy link
Contributor Author

jorwoods commented Feb 3, 2025

It would be great if case insensitivity were available with this as well.

@jorwoods
Copy link
Contributor Author

jorwoods commented Feb 3, 2025

Examples:

  1. How it works in the current version of TSC. An API call to the server for every user on the site:
def get_users_by_email(server: TSC.Server, emails: list[str]) -> dict[str, TSC.UserItem]:
    no_case_emails = [e.casefold() for e in emails]    
    users = {}
    for user in server.users.all():
        user = server.users.get_by_id(user.id)
        email = (user.email or "").casefold()
        if email in no_case_emails:
            users[email] = user
    return users
  1. How it would work if the filter was in place. Only one API call needed:
def future_get_users_by_email(server: TSC.Server, emails: list[str]) -> list[TSC.UserItem]:
    return list(server.users.filter(email__ciin=emails))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement needs investigation Issue needs to be looked at by Tableau
Projects
None yet
Development

No branches or pull requests

1 participant