question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to fetch all workbooks for users.populate_workbooks(user)

See original GitHub issue

Unable to fetch all workbooks for a given user.

Versions Details of your environment, including:

  • Tableau Online
  • Python 3.7+
  • tableauserverclient<=0.14.1

To Reproduce ` import tableauserverclient as tsc from tableauserverclient.server.endpoint.exceptions import ServerResponseError

    def get_workbooks_users(self) -> list: #tableau credentials are passed through Self

    list_workbooks_n_users = []
    try:
        with self.server.auth.sign_in(self.tableau_auth):
            for user in tsc.Pager(self.server.users):
                if 'tol.admin.api.broker.service.usera@tableau.com' not in user.name:
                    self.server.users.populate_workbooks(user)
                    for wkb in user.workbooks:
                        print(wkb.name, user.name)
                        list_workbooks_n_users.append({
                            'user_id': user.id,
                            'user_name': user.name,
                            'wb_id': wkb.id,
                            'wb_name': wkb.name,
                            'project_id': wkb.project_id,
                            'project_name': wkb.project_name,
                            "site_id": self.site_id
                        })
    except ValueError:
        print("some thing")
    finally:
        print("some other thing")
    return list_workbooks_n_users

`

Results I only get the first one hundred results for my user. I know the user has access to all tableau assets.

NOTE: Be careful not to post user names, passwords, auth tokens or any other private or sensitive information.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jorwoodscommented, Jan 22, 2022

@kdutta-c FYI, populating workbooks on a user will tell you all workbooks that that user owns, not all workbooks that they have access to. For owners, you can also use the metadata API, with a query like this:

query wbowners {
  workbooks{
    owner{
      luid
      username
    }
    luid
    name
    projectName
    site{
      luid
      name
    }
  }
}

Getting all content that a user has access to is a much more complicated affair, requiring checking the permissions of every item on the server. the group membership of each user, and so on… OR taking the equally complicated route of signing in to the site as each user and trying to query all workbooks on the server.

1reaction
adrianrlauscommented, Nov 22, 2021

Any update on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to Refresh Excel Workbook Links in SharePoint
We have an Excel workbook which looks for excel files via a VLOOKUP function. Every time I open the mail file, I get...
Read more >
Querying Tableau workbook permissions for all groups and ...
Data governance can be hard.In this tutorial we'll explore one way to automate the process of identifying exactly who (groups and users )...
Read more >
Open Excel files in separate windows and multiple instances
This post describes the easiest ways to open two or more Excel files in separate windows or new instances without messing with the...
Read more >
Packaged Workbooks - Tableau Help
In the workbook, right-click the data source in the Data pane and choose Extract Data. ; In the Extract Data dialog box, click...
Read more >
Make Your Macros Available in All Workbooks in Excel
All of the macros that we want to use in Excel will be stored within this personal macro workbook and will then be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found