Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Can we loop thro Qlik sense applist to call getlayout api using Node JS

Able to get the list of Qlik Sense app through GetDocList method using Node JS with Qsocks bundle downloaded from internet. I need to get the Sheet level information for each appid. I tried looping through the appId and tried calling createSessionObject & getlayout method. Getting the Sheet details only for the first appid. I feel some issue with the way which I'm calling getlayout method.

Below is the method where I'm passing each appid to get the sheet details. Please suggest me where I'm going wrong.

function CheckFunction1(id)    

   {

     qsocks.Connect(config).then(glob => {        

     glob.openDoc(id).then(function(app){  

      app.createSessionObject({

           qInfo: {

               qId: 'mysessionobject',

               qType: 'SheetList'

           },

           qAppObjectListDef: {

                qType: "sheet",

                qData: {

                  "title": "/qMetaDef/title",

                  "description": "/qMetaDef/description",

                  "thumbnail": "/thumbnail",

                  "cells": "/cells",

                  "rank": "/rank",

                  "columns": "/columns",

                  "rows": "/rows"

               },

               qInitialDataFetch: [{

                   qWidth: 1,

                   qHeight: 1000,

                   qLeft: 0,

                   qTop: 0

               }]

             },    

          })                

         .then(model => {

             model.getLayout().then(layout => {

                 console.log(layout);

                 }).                        

             model.on('close', () => {

                 app.destroySessionObject('mysessionobject')

             })

          })

      })

    })

   }

1 Reply
ErikWetterberg

Hi,

qsocks is old today, you should try switching to enigmajs instead. There you will also find some examples and other information to help you.

Erik Wetterberg