Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
tschollqlikview
Partner - Contributor III
Partner - Contributor III

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