Qlik Community

Integration, Extension & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Now Live: Qlik Sense SaaS Simplified Authoring – Analytics Creation for Everyone: READ DETAILS
Showing results for 
Search instead for 
Did you mean: 
Champion III
Champion III

Get variable value


Does anybody know a good, non deprecated, way in an extension to get the value of a Qlik Sense variable into a Javascript variable  ?

2 Replies
Partner - Creator II
Partner - Creator II

Do you mean something like this?

define( [




    function ( qlik, template ) {

        var app = qlik.currApp(this);

        return {

            template: template,

            support: {

                snapshot: true,

                export: true,

                exportData: false


            paint: function () {

                var qix = this.backendApi.model.enigmaModel.session;

                var numericValue;


                    variable.getLayout().then(function(variableLayout) {

                        numericValue = variableLayout.qNum;



                return qlik.Promise.resolve();


            controller: ['$scope', function ( $scope ) {



    } );



If your extension should be snapshottable, you should make sure the variable value is in the layout, something like this (haven't actually tested this code, so there might be syntax errors):



        qStringExpression: '="vBill"'



Or you could use qValueExpression.

You could also use the api's, but then you would have problems with snapshots: it might not work at all, or if it does does you would get the value when the snapshot is shown, not when it was taken.

Hope this helps

Erik Wetterberg