Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have an array of app ids. However if current user is not authorized on the app it gives "Forbidden" error. I don't want to try to open the app if it gives error and continue with next app id.
for (let i = 0; i < appIds.length; i++) {
getSheet(appIds[i]);
}
function getSheet(_appId) {
qlik.openApp(_appId, config);
}
I've tried the last answer of this thread but still error pops up and for loop breaks:
Thank you, this works!
However whenever console.log("error", _appId) runs it logs all previous app ids that gave an error too it logs all previous app ids even if they didn't give any error. Do you think that's because how on method works or my code is broken somehow?
openApp.on("error", function (error) {
console.log("error", _appId);
});
For example
if appid = "1" gave an error it logs
"error 1"
and after that appid = "2" gives an error then it logs
"error 1"
"error 2"
appid = "3" doesn't give any error.
appid = "4" gives an error and then:
"error 1"
"error 2"
"error 3"
"error 4"
and so on.
Your code is ok, this could be a bug. If you want you can open a support case for further investigation. Thanks!