\t  
Region:
\t
\t
  • Export PDF
  • \t\t\t
  • Export PPT
  • \t\t\t
  • Export CSV
  • \t
    \t\t Related articles: https://help.tableau.com/current/api/embedding_api/en-us/docs/embedding_api_filter.html   If this post resolves the question, would you be so kind to \"Select as Best\"?. This will help other users find the same answer/resolution and help community keep track of answered questions. Thank you.   Regards,   Diego Martinez Tableau Visionary and Forums Ambassador ", "upvoteCount": 1, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D5KX00000kSFr30AG", "datePublished": "2024-05-21T13:27:23.000Z", "author": { "@type": "Person", "name": "DIEGO FERNANDO MARTINEZ RODRIGUEZ", "url": "https://trailblazers.salesforce.com/profileView?u=0054S000001oPU8QAM", "affiliation": { "@type": "Organization", "name": "Modux" } } }, "suggestedAnswer": [] } } Skip to main content

    Hi Team,

     

    I have a .Net application where i embed my tableau server url now what i need is i have a client id for user login now i need to pass the client id in the embed url and need to display the dashboard.can anyone help me with this.(with that client id filtering after only i need to display the filtered dashboard)

    2 answers
    1. May 21, 2024, 1:27 PM

      @Eswaramoorthi k​ 

      Hi, when using the tableau-viz component, you can add filters:

      <tableau-viz

      id="tableauViz"

      width="1100"

      height="650"

      hide-tabs

      disable-url-actions=false

      src="https://public.tableau.com/views/LearnEmbeddedAnalytics/SalesOverviewDashboard"

      device="Desktop"

      toolbar="bottom"

      >

      <viz-filter field="Region" value="North"> </viz-filter>

      </tableau-viz>

      My example with Tableau Public:

      <!DOCTYPE html>

      <html lang="en">

      <head>

      <meta charset="UTF-8">

      <meta http-equiv="X-UA-Compatible" content="IE=edge">

      <meta name="viewport" content="width=device-width, initial-scale=1.0">

      <title>Your Embed Project</title>

      <!--- Load Tableau JavaScript API V3 --->

      <script type="module" src="https://public.tableau.com/javascripts/api/tableau.embedding.3.latest.min.js"></script>

      <script type="text/javascript">

      function RegionFilter(region) {

      const viz = document.getElementById('tableauViz');

      var sheet = viz.workbook.activeSheet;

      if (region === "") {

      sheet.applyFilterAsync('Region', [region], 'all');

      } else {

      console.log([region]);

      sheet.applyFilterAsync('Region', [region], 'replace');

      }

      }

      function exportToPDF() {

      const viz = document.getElementById('tableauViz');

      viz.displayDialogAsync("export-pdf");

      }

      function exportToPPT() {

      const viz = document.getElementById('tableauViz');

      viz.displayDialogAsync("export-powerpoint");

      }

      function exportToCSV() {

      const viz = document.getElementById('tableauViz');

      viz.displayDialogAsync("export-data");

      }

      </script>

      </head>

      <body>

       

      <!--- Viz Component - renders on page load --->

      <div id="controls" style="padding:20px;">

      Region: <select id="changeRegion" onchange="RegionFilter(value);">

      <option value="">All</option>

      <option value="Central">Central</option>

      <option value="North" selected>North</option>

      <option value="South">South</option>

      </select>

      </div>

      <div>

      <li><a style="background-color:#FFFFFF" id="aExportToPDF" href="javascript:exportToPDF();"

      class="cta">Export PDF</a></li>

      <li><a style="background-color:#FFFFFF" id="aExportToPPT" href="javascript:exportToPPT();"

      class="cta">Export PPT</a></li>

      <li><a style="background-color:#FFFFFF" id="aExportToCSV" href="javascript:exportToCSV();"

      class="cta">Export CSV</a></li>

      </div>

      <tableau-viz

      id="tableauViz"

      width="1100"

      height="650"

      hide-tabs

      disable-url-actions=false

      src="https://public.tableau.com/views/LearnEmbeddedAnalytics/SalesOverviewDashboard"

      device="Desktop"

      toolbar="bottom"

      >

      <viz-filter field="Region" value="North"> </viz-filter>

      </tableau-viz>

      </body>

      </html>

      Related articles:

      https://help.tableau.com/current/api/embedding_api/en-us/docs/embedding_api_filter.html

       

      If this post resolves the question, would you be so kind to "Select as Best"?. This will help other users find the same answer/resolution and help community keep track of answered questions. Thank you.

       

      Regards,

       

      Diego Martinez

      Tableau Visionary and Forums Ambassador

    0/9000