Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
d_pranskus
Partner - Creator III
Partner - Creator III

Variable API setStringValue and setNumValue is not working on Sense June SP1 release

Hi Qlik Experts

I am trying to set the variable value in my extension using Sense Variable API call. IT was working perfectly before.

I was using the following code snippet. Now it creates the variable, but no value is being set.

qlik.currApp().variable.getByName(variableName).then(function(model) {

    if (isNaN(variableValue)) {

        qlik.currApp().variable.setStringValue(variableName, variableValue);

    } else {

        var num = parseFloat(variableValue);

        qlik.currApp().variable.setNumValue(variableName, num);

    }

}, function(errorObject) {

    qlik.currApp().variable.create(variableName).then(function(model) {

        if (isNaN(variableValue)) {

            qlik.currApp().variable.setStringValue(variableName, variableValue);

        } else {

           var num = parseFloat(variableValue);

           qlik.currApp().variable.setNumValue(variableName, num);

        }

    })

});

Thanks

1 Solution

Accepted Solutions
d_pranskus
Partner - Creator III
Partner - Creator III
Author

Actually, the variable is being set, I can see it by adding the text box to the sheet, but when I look through Variables dialog - no value is there. Is this ok?

View solution in original post

2 Replies
d_pranskus
Partner - Creator III
Partner - Creator III
Author

Actually, the variable is being set, I can see it by adding the text box to the sheet, but when I look through Variables dialog - no value is there. Is this ok?

Ann-Louise-Andersson
Former Employee
Former Employee

Hello Darius,

Yes like you said, the variable is being set but it is not showing up in the Variables dialog in the client.

And it has always been like this, we will investigate it