2 Replies Latest reply: Aug 9, 2017 9:58 AM by Ann-Louise Andersson RSS

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

    Darius Pranskus

      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