Qlik Community

Ask a Question

Qlik Sense Integration, Extensions, & APIs

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

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor II
Contributor II

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

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