7 Replies Latest reply on Feb 14, 2018 4:46 AM by Lohith kumar

    Applying Async filter while the worksheet is being loaded


      Hi Everyone,


      We are working on integrating dashboard into our client portal. It has a filter that will take up to  7000 values and each value is up to six characters. This is not working when we pass through options as the values are being passed as URL parameter and there is a limit of 2083 characters. We are trying to use applyFilterAsync by using onFirstInteractive. However, it is not working as expected. The filter is not applied. It loads the original dashboard without the filter. Did anyone come across this issue? Please advise.


      Source Code:


      <script type="text/javascript" src="http://bi.accuratebackground.com/javascripts/api/tableau-2.js"></script>

        <script type="text/javascript">

        var tableauServerURL = "http://bicompany.com";



        var viz,workbook,activeSheet;

        var sheet;

        function initViz() {

        var containerDiv = null;


        containerDiv = document.getElementById("vContainer"),

        url = tableauServerURL

        + "/views/HomeFilters/NewVizHome?:embed=y&:showShareOptions=true&:display_count=no&:showVizHome=no",

        //+ "/views/DateHome/NewVizHome?:embed=y&:jsdebug=y&:display_count=no&:showVizHome=no",

        options = {

        hideTabs : true,

        hideToolbar : true,

        "Company Code": '',


        onFirstInteractive : function() {

        alert("this is interactive");


        var worksheet;

        viz.getWorkbook().activateSheetAsync("New Viz Home").then (function (sheet)


        worksheet = sheet;


        .then (function (){

        return worksheet.applyFilterAsync("Company Code",'COMPCODE1', tableau.FilterUpdateType.REPLACE);






        viz = new tableau.Viz(containerDiv, url, options);









      <body  onLoad="initViz()" >