Qlik Community

Integration, Extension & APIs

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

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
tschollqlikview
Partner
Partner

Changing variables and getting their values

Dear all,

I am faced with a problem that even after hours I could not solve:

In an extension I am calling this function:

switchStatus: function (id, varName, ValueOn, ValueOff ){

       var app = qlik.currApp();

       if($('#toggle'+ id).prop("checked")){

            app.variable.setStringValue(varName, ValueOn).then(function() {

                 var app2 = qlik.currApp();

                 app2.variable.getContent(varName, function(reply){

                 console.log(reply) // Always the initial value of the variable

            })

       });

  }

}

I am changing the value of the variable via

app.variable.setStringValue(varName, ValueOn);


I can see the change omthe GUI, however when trying to get the new value of the variable via

      app2.variable.getContent(varName, function(reply).....

the result is always the initial value of the variable.


What am I doing wrong?


1 Reply
nikoskavroulaki
Contributor II
Contributor II

Any luck with this one I am facing the same issue.

I am using the getContent and SetStringValue to get and set the value of variables.

SetStringValue changes the value, however the getContent does not update on the next iteration