Skip to main content

I need to retrieve the list of workbooks along with their corresponding views, extract the available filters and their values, and then enable the option to select filter values from this list in order to download the resulting data in CSV format. Is it possible to get this using the Tableau REST API/ Metadata API?

How can I get workbook names, views, filters with values, and download the filtered data as CSV? 

 

I would greatly appreciate any insights or recommendations. Thank you in advance for your support

2 件の回答
  1. 2025年9月10日 9:30

    Hi @Purushotham Reddy​ ,

    Please follow the below steps to achieve the requirements:

    1. Get workbook names & views - Possible via REST API:

     

    2. Get filters and their values:

    • The REST API only lets you set filter values when exporting a view (PDF/CSV/Image) — it does not expose the filter definitions (names & possible values).
    • The Metadata API (GraphQL) can tell you what fields exist in the workbook and which are used as filters, but it does not return the dynamic list of available filter values (because those come from the underlying data, not metadata).

    Options:

    • Static filter info (which fields are used as filters): use the Metadata API.
    • Dynamic filter values (actual values in the domain): not directly exposed. You’d need to:
      1. Query the underlying data (via Tableau Hyper API or direct DB connection), or
      2. Use the JavaScript Embedding API v3 (more interactive — you can list filters & their current values directly from the viz).

     

    3. Download filtered data as CSV - Possible via REST API:

    Query View Data lets you download the underlying (or summarized) data for a view in CSV format.You can apply filters when exporting by appending query params:

    /api/api-version/sites/site-id/views/view-id/data.csv?vf_filterName=value

    Example:

    GET /api/3.19/sites/123/views/456/data.csv?vf_Region=Central&vf_Category=Furniture

    • vf_prefix must match the field name of the filter.