Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
IVAN-FELIPE
Employee
Employee

enigmaModel accesible for a second app

Dear colleagues

I'm trying to use enigmaModel in an extension to update some values of the currentApp and others, with limited success.

I can use the enigmaModel.engineApp methods for the current app.

But when I try to open a second app and update the same values for this new app it does not works the same way.

I'm trying this for the second app:

var config = {

host: window.location.hostname,

prefix: "/",

port: window.location.port,

isSecure: window.location.protocol === "https:",

identity: 'mymachine/administrator' (this is the services owner )

};

//THIS 2f6622a8-43e1-4207-b8c7-33d645dec81a CORRESPONDS TO A DIFFERENT APP THAN THE OPENED ONE

var newApp = qlik.openApp('2f6622a8-43e1-4207-b8c7-33d645dec81a',config);

After that I can show all the content of the second newApp, I can see in the browser console all the elements, included enigmaModel and engineApp--> console.log(newApp) Works!

But I can't use the methods included in the enigmaModel of the other app even when I open it successfully, like enigmaModel.engineApp.cloneObject

And console.log(newApp.enigmaModel) -->just shows undefined, even when the console.log(newApp) shows all the content.

Any ideas??

Thanks!!

2 Replies
Aiham_Azmeh
Employee
Employee

Hi ife‌,

Most probably the synchronous openApp method didn't manage to fill the property with enigmaModel, try to wrap your code with  app.model.waitForOpen.promise.then(()=>{....}


The enigma model is not exposed/ documented/supported, I strongly advise you not to use it. What are you trying to achieve? what enigmaModel API do you need?

IVAN-FELIPE
Employee
Employee
Author

Thanks a log Aiham, this works!

I'm working with enigmaModel.engineApp for updating global items in several apps when needed.

It was just a problem of time to refresh and your suggestion fixed it.

Regards