Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

geetika_garg01
New Contributor

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
erik_wetterberg
Honored Contributor

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

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

Erik Wetterberg
https://extendingqlik.upper88.com/
Community Browser