Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
firstly i want to say that i'm totally newbie in javascript. What i want to do is get app list from server, then filter returned array to get 1 app and then open that app and use app methods to get for example list of dimensions.
I've managed to get app list from server and to filter that result to get 1 appId. But i don't know how to use second global function method to open that app. Here is my code:
var fs = require('fs');
const session = createSession();
session.open()
.then(function(global) {
global.getDocList().then(function(docList) {
console.log(JSON.stringify(docList));
for (i = 0; i < docList.length; i++) {
var AppName = docList[i].qDocName;
console.log('Field list:',JSON.stringify(AppName));
}
var docId = docList.filter(obj => obj.qTitle =='test222' )[0].qDocId;
console.log(docId);
session.close();
return docId;
}, function(err) { console.log('5')})
}, function(err) { console.log('It seems Sense is not responding')});
I need to pass docId to global.OpenApp() method
Hope you will help me!
Thanks
Hello Jacek,
I have just added one line to open the app which you wanted
here's the code
const createSession = require('./session');
var fs = require('fs');
const session = createSession();
session.open()
.then(function(global) {
global.getDocList().then(function(docList) {
console.log(JSON.stringify(docList));
for (i = 0; i < docList.length; i++) {
var AppName = docList[i].qDocName;
console.log('Field list:',JSON.stringify(AppName));
}
var docId = docList.filter(obj => obj.qTitle =='test222' )[0].qDocId;
console.log(docId);
global.openDoc(docId); //this is the line i have added
session.close();
return docId;
}, function(err) { console.log('5')})
}, function(err) { console.log('It seems Sense is not responding')});
Try this
Thanks & regards,
Prashant