How to print projects and workbook names based on site id in tableau server client

0 votes
SIGN IN

    tableau_auth = TSC.TableauAuth(args.username, password, args.site)

    server = TSC. Server(args.server, use_server_version=True)

    with server.auth.sign_in(tableau_auth):

        print("Your server contains the following sites:")

        for site in TSC.Pager(server.sites.get):

            print(site.name)

        i=input("Enter the site name :")

        print(i)

    for project in TSC.Pager(server.sites.projects.get):

        print(project.name)

In the Tableau server client I am able to print the site ID. Based on the site ID, I need to print a project and workbook. In the above code the user gets the list of siteIDs that belong to his role. The user selects the site ID and I have stored an object "i" based on the site name. How can I drill down to a project and workbook?

Mar 8, 2022 in Tableau by Vaani
• 7,070 points
1,707 views

1 answer to this question.

0 votes

Here's how I do it once I've got my site id.

auth = TSC.TableauAuth('username', 'password', site_id=i)
server = TSC.Server(serverAddress) 
with server.auth.sign_in(auth):
    all_project_items, pagination_item = server.projects.get()
    for proj in all_project_items:
        print(proj.id)

    all_workbooks, pagination_item = server.workbooks.get()
    for workbook in all_workbooks:
        print(workbook.name)
answered Mar 9, 2022 by Neha
• 9,020 points

Related Questions In Tableau

0 votes
1 answer

How to color code cells of a column based on the text value in Tableau

You can use the following steps to ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,240 points
9,832 views
+1 vote
2 answers

How to join tables based on “Calculated Fields” in Tableau?

You absolutely can join to a calculated ...READ MORE

answered May 30, 2019 in Tableau by anonymous
24,466 views
0 votes
1 answer

How to get multiple Sets of Measure Names with different Filters on a single sheet in Tableau?

The easiest solution to your query is: 1) ...READ MORE

answered Aug 23, 2018 in Tableau by Naruto
• 710 points
15,296 views
0 votes
1 answer
0 votes
0 answers

Getting prep_int() not defined error in tableau prep

I'm using Tableau Prep with Python Script, ...READ MORE

Mar 2, 2022 in Tableau by Vaani
• 7,070 points
702 views
0 votes
0 answers

Error Running python (forecasting) in Tableau

I'm quite new to this system as ...READ MORE

Mar 31, 2022 in Tableau by Vaani
• 7,070 points
428 views
0 votes
1 answer

Word Clouds using TabPy

I worked on a project in R ...READ MORE

answered Apr 21, 2022 in Tableau by Neha
• 9,020 points
932 views
0 votes
0 answers

Using Python and Tableau in conjunction with one another

Is it possible to mix Python visualisations ...READ MORE

Feb 28, 2022 in Tableau by Vaani
• 7,070 points
490 views
0 votes
1 answer

How do I add a custom login and logout page in my Tableau Server on-prem?

I don't believe it is "officially" possible ...READ MORE

answered Mar 4, 2022 in Tableau by Neha
• 9,020 points
728 views
0 votes
1 answer

How to share a workbook with client in Tableau who do not have Tableau account or tableau reader

It's possible that there isn't a way ...READ MORE

answered Apr 5, 2022 in Tableau by Neha
• 9,020 points
631 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP