Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

tvaditya
New Contributor

Problems trying to get value of expressions via javascript ( Node.js).

Hi

I am having problems trying to get the values of some expressions I am running the code below: I am able to open the document but do not get the string i am trying to print out.. it remains all blank , can´t understand why?

const qsocks = require('qsocks');


qsocks.Connect().then(global => {

   console.log("****** Connection Open ******");

   return global.openDoc('Sales Discovery.qvf');

  

}).then(app => {

   console.log("****** Document Open ******", app);

   app.createGenericObject( {

   user: {

   qStringExpression: "=QVUser ()"

  },

   version : {

   qStringExpression: "=QlikViewVersion ()"

  },

   fields: {

   qValueExpression: "=Count (DISTINCT $Field)"

  }

  }, function ( reply ) {

   var str = "Version:" + reply.version + " Fields:" + reply.fields;

   if ( reply.user ) {

   str += " User:" + reply.user;

  }

   console.log(str);

  });


})

Basically, what I would like to see is the outcome of this last line console.log(str)

1 Reply
tvaditya
New Contributor

Re: Problems trying to get value of expressions via javascript ( Node.js).

It looks like it ain´t even creating the generic object

Community Browser