The enigma.js function createSessionObject is used to create a list object. The definition of what the list object should contain is defined by a json structure and is passed as a parameter. This json structure varies depends on what you want to fetch.
Below is the definition to get the list of variables from an app
{ "qInfo": { "qType": "VariableList", "qId": "" }, "qVariableListDef": { "qType": "variable", "qData": { "tags": "/tags" } } }
Example
qSession=enigma.create(config); qSession.open().then((global) => { qGlobal=global; qGlobal.openDoc(app_id).then((app) => { currApp=app; currApp.createSessionObject(qParam).then(function(qObject){ console.log("created object"); qObject.getLayout().then(function(qProp){ res.json({msg:qProp.qVariable.qItems}) }, (e)=> {console.log(err);res.json(err)}); } ,(err)=>{ console.log(err);res.json(err)}) ; }) },(err)=>{ console.log(err);res.json(err)})
Read blog post Qlik sense Enigmajs Create, Open session and list apps for more details on creating a session. For the complete list of enigma.j example follow theĀ Qlik sense Enigma.js Example Series posts