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 in Tableau by Vaani
• 7,020 points
153 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 by Neha
• 8,560 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,230 points
8,051 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
17,845 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
11,297 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 in Tableau by Vaani
• 7,020 points
62 views
0 votes
0 answers

Error Running python (forecasting) in Tableau

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

Mar 31 in Tableau by Vaani
• 7,020 points
39 views
0 votes
1 answer

Word Clouds using TabPy

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

answered Apr 21 in Tableau by Neha
• 8,560 points
59 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 in Tableau by Vaani
• 7,020 points
62 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP