7 Replies Latest reply: Mar 16, 2017 1:52 PM by Haikuo Yu RSS

    Example of using exportData method

    Mark Wallington

      Hi,

       

      Is someone able to help me with an example of how to use the exportData method, documented here:

      https://help.qlik.com/en-US/sense-developer/2.2/Subsystems/APIs/Content/TableAPI/exportData-method.htm

       

      I would like to create a button in my HTML mashup page, which exports the data held in a Qliksense table that has been embedded in the mashup page.

       

      I can see from the code example it is simple to assign exportData method to the button. What I am struggling with initialising the qTable variable with the correct table object.

       

      I am pulling the table into my mashup with the Javascript below, and the relevant div to be populated in the HTML has a data-qvid attribute where the objectID for the Qliksense object is populated.

       

      var app = qlik.openApp( "myApp.qvf", config );
      
      $( ".qvobject" ).each( function () {
                var qvid = $( this ).data( "qvid" );
                app.getObject( this, qvid ).then( function ( object ) {
                          qvobjects[qvid] = object;
                } );
           } );
      

       

      So how do I then access the app variable I create above, to populate a new variable like the below using the relevant objectID:

      var qTable = qlik.table(this);