Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

d_pranskus
Contributor 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
Contributor III

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

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?

2 Replies
d_pranskus
Contributor III

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

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?

add
Contributor II

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

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

Community Browser