6 Replies Latest reply on Aug 16, 2018 11:16 AM by Man Tsui

    How to apply multiple parameters through javascript api.

    Rahul Tokase

      Hi

       

      I have embedded a workbook into my web application. In a workbook we have created a parameter for FromDate, ToDate and Timezone.

       

      In our web application user can selects the calendar from and todate for which he/she wants to see the data in the dashboard.

       

      My issue is through javascript api using following method

      workbook.changeParameterValueAsync("FromDate", new Date(Date.UTC(2014, 0, 1)));

       

      I can apply one parameter value at a time.

       

      So My question is How can i set all three parameter values in one go in one changeParameterValueAsync call ?

       

      Right now I am doing it through the following way.

      workbook.changeParameterValueAsync("FromDate", new Date(Date.UTC(2014, 0, 1))).then(function(){

           workbook.changeParameterValueAsync("ToDate", new Date(Date.UTC(2014, 1, 1))).then(function(){

               

           })

      })

       

      is It a correct way of setting multiple parameter values through javascript api ?

       

      Or can I do like as mention below ? Here i am not waiting for first call to return.

      workbook.changeParameterValueAsync("FromDate", new Date(Date.UTC(2014, 0, 1)));

      workbook.changeParameterValueAsync("ToDate", new Date(Date.UTC(2014, 0, 1)));