1 Reply Latest reply: Jun 28, 2018 2:42 PM by Tantravahi Aditya RSS

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

    Tantravahi Aditya

      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)